执行存储过程没有返回任何结果,我也设置了输出函数,求各位帮忙解答!
createprocedurestu_prog2@Snamevarchar(10),@avg_Gradefloatoutputasselect@avg_Grade=AVG...
create procedure stu_prog2
@Sname varchar(10),
@avg_Grade float output
as
select @avg_Grade = AVG(Grade)
from SC
inner join Student on Student.Sno = SC.Sno
where Sname = @Sname
go
declare @char varchar(20),@avg_Grade float
set @char = '成绩为: '
exec stu_prog2 '李晨',@avg_Grade output
print rtrim(@char) + ltrim(cast(@avg_Grade as float)) 展开
@Sname varchar(10),
@avg_Grade float output
as
select @avg_Grade = AVG(Grade)
from SC
inner join Student on Student.Sno = SC.Sno
where Sname = @Sname
go
declare @char varchar(20),@avg_Grade float
set @char = '成绩为: '
exec stu_prog2 '李晨',@avg_Grade output
print rtrim(@char) + ltrim(cast(@avg_Grade as float)) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询