更新时间:2023-12-01 08:12:10
这是正确的行为.
如果您将@item1
设置为一个值,则以下表达式将为真
if you set @item1
to a value the below expression will be true
IF (@item1 IS NOT NULL) OR (LEN(@item1) > 0)
无论如何在 SQL Server 中没有这样的功能,但您可以创建自己的功能:
Anyway in SQL Server there is not a such function but you can create your own:
CREATE FUNCTION dbo.IsNullOrEmpty(@x varchar(max)) returns bit as
BEGIN
IF @SomeVarcharParm IS NOT NULL AND LEN(@SomeVarcharParm) > 0
RETURN 0
ELSE
RETURN 1
END