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

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;

转载于:https://www.cnblogs.com/williamwindy/archive/2009/11/15/1603472.html

你可能感兴趣的:(后端)