1
2
3
4
5
6
7
8
9
10
|
declare @cypic varchar
if ( NULLIF (@cypic, ‘‘ ) IS
NOT NULL )
begin print 1
end else begin print 2
end |
结果是:2
NULLIF方法是把为‘’的变成NULL 然后再判断 IS NOT NULL