Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Stored Proc from a Stored Proc-Help!

Status
Not open for further replies.

aspengal

Technical User
Dec 27, 2004
41
US
Hi Friends,

I would like to Call SP2 from SP1. SP2 will exeucute and pass an output parameter back to SP1. can someone pls. help me with the syntax?

In SP2, I will declare var_out_param and assign a value to it. I need to validate this value in SP1.

Is it " exec SP2(var_out_param)"???

Help!
 
Code:
Create proc a
@a int,
@b int output
as
set @b = @a * @a
go
Create proc b
@a int,
@b int output
as
exec a @a, @b
go
declare @o int 
exec a 3,@o output
select @o
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top