存储过程错误、?

liao71 2003-12-07 09:21:16
commandtext does no reture a result set 是什么意思?
...全文
34 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
liao71 2003-12-07
  • 打赏
  • 举报
回复
use buygoods1
go
if object_id('dbo.InGoodsList') is not null
drop procedure dbo.InGoodsList
go
create procedure dbo.InGoodsList
@code char(2)=null,
@ckyear int=null,
@item int=null,
@condition varchar(30)=null
as
if(@code='A')
begin
select * From InGoods where CKYEAR=@ckyear order by item
return
end
if(@code='A0')
begin
select * From InGoods where CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='A1')
begin
select * From InGoods where CKYEAR=@ckyear and STATUS='OK' order by item
return
end
if(@code='C')
begin
select * From InGoods where Customer=@condition and CKYEAR=@ckyear order by item
return
end
if(@code='C0')
begin
select * From InGoods where Customer=@condition and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='C1')
begin
select * From InGoods where Customer=@condition and CKYEAR=@ckyear and STATUS='OK' order by item
return
end
if(@code='V')
begin
select * from InGoods where vendor= @condition and CKYEAR=@ckyear order by item
return
end
if(@code='V0')
begin
select * from InGoods where vendor= @condition and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='V1')
begin
select * from InGoods where vendor= @condition and CKYEAR=@ckyear and STATUS='OK' order by item
return
end
if(@code='M')
begin
select * from InGoods where Model like @condition+'%' and CKYEAR=@ckyear order by item
return
end
if(@code='M0')
begin
select * from InGoods where Model like @condition+'%' and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='M1')
begin
select * from InGoods where Model like @condition+'%' and CKYEAR=@ckyear AND STATUS='OK' order by item
return
end
if(@code='D')
begin
select * from InGoods where DESCRIPTION like @condition+'%' and CKYEAR=@ckyear order by item
return
end
if(@code='D0')
begin
select * from InGoods where DESCRIPTION like @condition+'%' and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='D1')
begin
select * from InGoods where DESCRIPTION like @condition+'%' and CKYEAR=@ckyear and STATUS='OK' order by item
return
end
if(@code='R')
begin
select * from InGoods where RPNO=@condition and CKYEAR=@ckyear order by item
return
end
if(@code='R0')
begin
select * from InGoods where RPNO=@condition and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='R1')
begin
select * from InGoods where RPNO=@condition and CKYEAR=@ckyear and STATUS='OK' order by item
return
end
if(@code='X')
begin
select * from InGoods where insp_date like @condition+'%' order by item
return
end
if(@code='X0')
begin
select * from InGoods where insp_date like @condition+'%' and STATUS='NG' order by item
return
end
if(@code='X1')
begin
select * from InGoods where insp_date like @condition+'%' and STATUS='OK' order by item
return
end
if(@code='S')
begin
select * from InGoods where Source= @condition and CKYEAR=@ckyear order by item
return
end
if(@code='S0')
begin
select * from InGoods where Source= @condition and CKYEAR=@ckyear and STATUS='NG' order by item
return
end
if(@code='S1')
begin
select * from InGoods where Source= @condition and CKYEAR=@ckyear and STATUS='OK' order by item
return
end
go
Rotaxe 2003-12-07
  • 打赏
  • 举报
回复
命令没有返回结果集。
把具体代码贴出来看一下

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧