丁丁 发表于:2010-07-29 16:28:31
竹笛先生:请教一个小题:以下存储过程:xs_price 为 money类型
ALTER PROCEDURE 存储过程9
AS
SET NOCOUNT ON
declare @sql nvarchar(4000)
DECLARE @en money,@be money
set @en=200
set @be=100
set @sql='SELECT SpnameID'
select @sql=@sql +', SUM(CASE WHEN Xs_price between @be AND @en THEN xs_amount ELSE NULL END) AS Expr1 FROM dbo.st_Xsmixi_cx GROUP BY SpnameID'
exec(@sql)
RETURN
以上存储过程错误提示:必须声明be变量,可我已经声明了的呀。怎么解决?
终于解决:供大家参考
ALTER PROCEDURE 存储过程9
AS
SET NOCOUNT ON
declare @sql nvarchar(4000)
DECLARE @en money,@be money
set @en='200'
set @be='100'
set @sql='SELECT SpnameID'
select @sql=@sql +', SUM(CASE WHEN Xs_price between @be AND @en THEN xs_amount ELSE NULL END) AS Expr1 FROM dbo.st_Xsmixi_cx GROUP BY SpnameID'
exec(@sql)
RETURN
以上存储过程错误提示:必须声明be变量,可我已经声明了的呀。怎么解决?
总记录:1篇 页次:1/1 9 1 :