我有一个大的SQL表,其中包含" #N / A N / A"跨越多列/行。
如何应用存储过程将所有这些值转换为NULL值。
答案 0 :(得分:2)
create table ##test2
(a1 varchar(200))
insert into ##test2 values('#N/A N/A'),('abc'),('#N/A N/A')
select * from ##test2
create proc dbo.ex1 as
begin
set nocount on
update ##test2 set a1=null where a1='#N/A N/A'
end
select * from ##test2