首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

简单有关问题,怎么判断为“”

2013-06-26 
简单问题,如何判断为“”存储过程中有一个变量从外部传入@strValue如何判断其为null 和 if strValue is nu

简单问题,如何判断为“”
存储过程中有一个变量从外部传入
@strValue
如何判断其为null 和 ''

if strValue is null---------判断为null
如何判断是空字符串 ‘’?




[解决办法]
isnull(@strValue,'')=''
[解决办法]

if(@strValue = '' Or @strValue is null)

[解决办法]
Declare @v1 as varchar(10) = '1';
If(LEN(@v1) != 0 And @v1 is not null)--如果不为空串且不为null
print('yes');

[解决办法]


 DECLARE @STR VARCHAR(20)
 IF(ISNULL(@STR,'')='')
 BEGIN
    PRINT 1;
 END
 ELSE
    PRINT 0;

热点排行