为存储过程传参数并接收返回的值

create procedure select_procedure(@ID int,@num int output)
as
declare @n int
set @n = 0
select @n = count(*) from Employee where oid=@ID
set @num = @n
return @num
go

 

declare @value int
declare @res int
set @value = 1
execute select_procedure @value,@res output
print @res;

posted @ 2009-11-15 20:53  williamwindy  阅读(146)  评论(0编辑  收藏  举报