Execute
Stored Procedure with Output Parameter?
exec getempmgr 7566,@r output
select @r
declare @s int
exec getempmgr 7698,@mgrid=@s out
select @s
declare @t int
exec getempmgr @empid=7698,@mgrid=@t out
select @t
select * from empdet
Creating Stored procedures with Output parameter:
create proc getempmgr
@empid int,
@mgrid int output
as
begin
select @mgrid=mgr
from empdet
where empno=@empid
end
Executing Stored Procedures with output parameter:
exec getempmgr 7566,@r output
select @r
declare @s int
exec getempmgr 7698,@mgrid=@s out
select @s
declare @t int
exec getempmgr @empid=7698,@mgrid=@t out
select @t
No comments:
Post a Comment