日期:2014-05-18  浏览次数:20450 次

不能比较或排序 text、ntext 和 image 数据类型

下面是存储过程代码

create   procedure   myproc
@body   ntext
as

这里要判断用户给的body   参数是否是空的?   然后在执行存储过程
if(body <> ' ')
begin
    --   xxxxxxxxxxxxx
end


提示错误,怎么办?   用   is   null   好象也不正确



------解决方案--------------------
create procedure myproc
@body ntext
as

if(@body is not null)
begin
print '111 '
end
你使用变量的时候搞错了!!