空字符串的问题!如何判定一个字符串为空?谢谢 我的代码是@td nvarchar(50) if @TD='' set @TD=null我在调试时,输入''(两个单引号),可是if @TD=''仍判断为假如何才能判断为真? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 @td nvarchar(50) set @id = ''if @TD='' set @TD=null if @td is null set @td=null set @td=case when len(isnull(@td,''))=0 then null else @dt end if @TD='' set @TD=null这样已经是正确的吧, declare @td nvarchar(50) set @td =''if @td ='' set @TD=null select @td --貌似判断结果就是为真的吧?declare @td nvarchar(50) set @td = ''if @TD='' set @TD=null select @TD结果:NULL 没赋初始值就不正确.declare @td nvarchar(50) if @TD='' print '@td 为空'else print '@td 不为空'/*@td 不为空*/declare @td nvarchar(50) set @td = ''if @TD='' print '@td 为空'else print '@td 不为空'/*@td 为空*/ 我是从vb中向存储过程中的参数@TD传值的,vb中我输入的是"" 可是在执行if @TD='' set @TD=null ,仍不能得到set @TD=null 的结果 试试if len(rtrim(ltrim(@TD)))=0 set @TD=null或者if @td is null set @TD=null vb中nothing表示空,‘’就不是了 @td nvarchar(50) if len(@TD)=0 print '@td 为空'else print '@td 不为空' @td nvarchar(50) set @id = '' if @TD='' set @TD=null 对数据分组处理怎么弄? 关于移动物理文件语句 sql server 数据库中的表不设主键与设一个无意义的标识种子主键有什么区别 求段统计SQL 数据库多人同时访问 问个关于JOIN的问题。。。。 SQL连接问题,急~~~~ txlicenhe(马可&不做技术高手)请进 如何使用SQL Server的Full-Text Search? 谁能帮我翻译一段函数的定义.原来是Oracle,帮我换成SQL Server. 关于GROUP BY和的疑惑 求:该查询语句怎么写?
set @id = ''
if @TD='' set @TD=null
set @td=null
if @TD='' set @TD=null
这样已经是正确的吧,
set @td =''
if @td ='' set @TD=null select @td
declare @td nvarchar(50)
set @td = ''
if @TD='' set @TD=null select @TD结果:NULL
print '@td 为空'
else
print '@td 不为空'
/*
@td 不为空
*/
declare @td nvarchar(50)
set @td = ''
if @TD=''
print '@td 为空'
else
print '@td 不为空'
/*
@td 为空*/
if len(rtrim(ltrim(@TD)))=0 set @TD=null或者
if @td is null set @TD=null
@td nvarchar(50)
if len(@TD)=0
print '@td 为空'
else
print '@td 不为空'
set @id = ''
if @TD='' set @TD=null