码迷,mamicode.com
首页 > 数据库 > 详细

SQL_存储过程return返回值

时间:2014-10-06 01:24:39      阅读:359      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   ar   sp   div   c   log   r   

--定义存储过程
create procedure GetReturnValue
@className nvarchar(50),
@Age int
as 
begin
declare @maxScore int
select @maxScore=MAX(chinese) from Students where ClassName=@className and Age>@Age
return @maxScore
end


declare @returnValue int
exec @returnValue = GetReturnValue 高三一班,18
select @returnValue as 返回值

 

SQL_存储过程return返回值

标签:style   blog   color   ar   sp   div   c   log   r   

原文地址:http://www.cnblogs.com/zwhFighting/p/4007507.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!