存储过程中 如何在Exec (✀...✀)中 判断某字段是否为空?

2025-05-06 08:27:40
推荐回答(2个)
回答1:

创建存储过程
create procedure MyProc
@para1 int,  --参数一
with encryption--加密
as
select top @paral * from 表名 where PicUrl<>' '

使用存储过程
exec MyPro 10

回答2:

Exec('select top '+@Num+' PicUrl,* form Test where PicUrl is not null')