日期:2014-05-18 浏览次数:20610 次
--这里应该是 CREATE PROCEDURE proc_inforin ( @语文1 [float],@语文2 [float],@语文3 [float] ) as BEGIN DECLARE @语文总1 varchar(8000) declare @i [int] set @i=1 while @i<=3 if '@语文' is not null or @i is null begin set @语文总1 = '@语文' & ltrim(@i) +@语文总1 set @i=@i+1 end end
------解决方案--------------------
CREATE PROCEDURE proc_inforin ( [@语文1] float=0.0, [@语文2] float=0.0, [@语文3] float=0.0 ) as BEGIN DECLARE [@语文总1] float set @语文总1 = @语文1 +@语文2+@语文3 end