字符串变量的空或空检查 [英] Null or empty check for a string variable
本文介绍了字符串变量的空或空检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
if((isnull(@value,''))='')
我想知道上面这段代码在检查变量是否为空或为空时是否有效.
I want to know whether the above piece of code works in checking if the variable is null or empty.
推荐答案
是的,该代码正是这样做的.
Yes, that code does exactly that.
您也可以使用:
if (@value is null or @value = '')
使用 @value
是 int
值的附加信息,您需要:
With the added information that @value
is an int
value, you need instead:
if (@value is null)
int
值永远不能包含值 ''
.
An int
value can never contain the value ''
.
这篇关于字符串变量的空或空检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文