同时带Return和output参数的存储过程
if exists(select name from sysobjects where name=’up_user’ and type=’p’)
drop proc up_user
go
create proc up_user
@id int,
@name varchar(20) output
as
declare @age int
begin
select @age=stuage,@name=stuname from stuinfo where uid=@id
return @age
end
--执行该存储过程
declare @age int
declare @name varchar(20)
exec @age=up_user 2,@name output
select @age,@name