标签:style blog color ar sp div c log r
--定义存储过程 create procedure GetOutInfo @className nvarchar(50), @Age int, @maxScore int output, @avrageScore int output, @stuCount int output as begin select * from Students where ClassName=@className and Age>@Age select @maxScore=MAX(chinese) from Students where ClassName=@className and Age>@Age select @avrageScore=AVG(chinese) from Students where ClassName=@className and Age>@Age select @stuCount=COUNT(*) from Students where ClassName=@className and Age>@Age end go --调用存储过程 declare @max_score int declare @avg_score int declare @count_stu int exec GetOutInfo ‘高三一班‘,18,@max_score output,@avg_score output,@count_stu output select ‘zuigaofen‘=@max_score,‘pingjunfen‘=@avg_score,‘renshu‘=@count_stu
标签:style blog color ar sp div c log r
原文地址:http://www.cnblogs.com/zwhFighting/p/4007505.html