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

小弟我指定了if(@activeNum=null)set @activeNum=0; ,为什么最后@activeNum是空值

2012-01-14 
我指定了if(@activeNumnull)set @activeNum0 ,为什么最后@activeNum是空值?declare@activeNumintdecla

我指定了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)

热点排行