读书人

小弟我指定了if(@activeNum=null)set

发布时间: 2012-01-14 20:02:35 作者: rapoo

我指定了if(@activeNum=null)set @activeNum=0; ,为什么最后@activeNum是空值?
declare @activeNum int;
declare @netbarNum int;

if @withlevel= '主管 '

begin

select @activeNum=sum(A.activeNums) ,@netbarNum=sum(A.netbarNums)

from SpreaderDteDinfo A inner join SpreaderContact C on A.userID=C.userid

where A.weekid=@weekid and C.upuserid=@SpreadID



if(@activeNum=null)

begin

set @activeNum=0;这里我指定了0,但是最后update的值还是空的,为什么?

end



if(@netbarNum=null)

begin

set @netbarNum=0;

end

print @activeNum
message里面什么都没有,为什么?判断空条件错了码?




[解决办法]
--if(@activeNum=null)

if (@activeNum is null)

读书人网 >SQL Server

热点推荐