在存储过程中查询null值无法使用需要做一些处理
在sql查找非空数据可使用
select * from student where name is null;
在sql查找赋值有空值时可赋值默认值
declear @arg_name varchar(32);
select @arg_name = isnull(name, '未知姓名') from student where userId = 101;
在sql存储过程有空值时需要判空处理
declear @arg_name varchar(32);
select @arg_name = name from student where userId = 101;
if (@arg_name is null)
return 1;
或者
if (@arg_name is not null)
return 0