首页 > 代码库 > SQL_存储过程返回值
SQL_存储过程返回值
--定义存储过程create procedure GetOutInfo@className nvarchar(50),@Age int,@maxScore int output,@avrageScore int output,@stuCount int outputas beginselect * from Students where ClassName=@className and Age>@Ageselect @maxScore=MAX(chinese) from Students where ClassName=@className and Age>@Ageselect @avrageScore=AVG(chinese) from Students where ClassName=@className and Age>@Ageselect @stuCount=COUNT(*) from Students where ClassName=@className and Age>@Ageendgo--调用存储过程declare @max_score intdeclare @avg_score intdeclare @count_stu intexec GetOutInfo ‘高三一班‘,18,@max_score output,@avg_score output,@count_stu outputselect ‘zuigaofen‘=@max_score,‘pingjunfen‘=@avg_score,‘renshu‘=@count_stu
SQL_存储过程返回值
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。