如何返回多个参数
....
SET NOCOUNT ON;
declare @WMaoValue decimal;
declare @NMaoValue decimal;
declare @TotalValue decimal;
if LEN(@ckykmemo)=0
begin
SELECT @WMaoValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and MWMao !='内贸' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate
SELECT @NMaoValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and MWMao ='内贸' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate
SELECT @TotalValue = SUM (DCKC ) +SUM (ZHRD ) FROM dbo.tbCCData
where CKYKFlag ='未出清' and HTSHR like '%'+@htshr and ChuanMing like '%'+@chuanming and PinMing like '%'+@pinming and MWMao like '%' +@nwmao and RKRQ between @begindate and @enddate
end
如果不采用参数输出形式,怎么能同时返回三个参数的值,并在表中显示出来
??return select @WMaoValue ,@nwmao ,@TotalValue 可以码?
sqlserver
------解决方案--------------------以table形式返回结果不行吗?
------解决方案--------------------可以试下使用ref,或者把要返回的值放入一个数组中返回
------解决方案--------------------存储过程可以使用多个output参数啊 ,参考MSDN
http://msdn.microsoft.com/zh-cn/library/ms187926.aspx