全为空?还是某行为空? if exists (select 1 from tb where col is not null) else
--全为空 if exists (select 1 from tb where col is not null) print '不全为空' else print '全为空'--某行select id , case when col is null then '空' else '非空' end from tb
select 字段名 is null from 表名
select * from 表名 where isnull(字段名,'')=''
写错了。 if exists (select * from 表名 where 列名 is null) print '存在列为空的'
if exists (select 1 from tb where col is not null)
else
if exists (select 1 from tb where col is not null)
print '不全为空'
else
print '全为空'--某行select id , case when col is null then '空' else '非空' end from tb
from 表名
if exists (select * from 表名 where 列名 is null)
print '存在列为空的'