【SQL开源代码栏目提醒】:本文主要为网学会员提供GetInspected.sql,希望对需要GetInspected.sql网友有所帮助,学习一下!
use BuyGoods
go
if object_id('dbo.GetInspected') is not null
drop procedure dbo.GetInspected
go
create procedure GetInspected
@ckyear int=null,
@ckmonth int=null,
@vendor varchar(30)=null,
@flag char(1)=null
as
if(@flag='A')
begin
select item=count(*) from InGoods where vendor=@vendor
and ckyear=@ckyear and ckmonth=@ckmonth
return
end
if(@flag='Y')
begin
select item=count(*) from InGoods where vendor=@vendor
and ckyear=@ckyear and ckmonth=@ckmonth and status='OK'
return
end
go