Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

What is the syntax to call stored procedure in stored procedure ?

my inner stored procedure will return two value for outer stored procedure

then how to get that both values ?

--

Thanks
Posted
Updated 21-Jan-11 20:01pm
v2

exec storedproc_name @param1, @parm2, etc...
 
Share this answer
 
This should help:
EXECUTE[^]

Regards
Espen Harlinn
 
Share this answer
 
Hi,

Sample code for your reference...


//Procedure 1
Create proc stp_Test1
as
begin
    select * from table
end

//Procedure 2
create proc stp_Test2
as
begin
     // To call the Procedure stp_Test1 in this procedure
     // Its return that Procedure output.
     exec stp_Test1     
end


Cheers :)
 
Share this answer
 
 
Share this answer
 
Comments
Member 13726685 20-Apr-18 7:52am    
sir my question is this----

create procedure where increament in salary column by 50% and also show or display the result at the same time in sql server..
Member 13726685 20-Apr-18 7:53am    
sir/madam mnjkumar773@gmail.com is my email id...
thatraja 20-Apr-18 13:06pm    
https://www.codeproject.com/Questions/ask.aspx
Unfortunately we don't provide anything instant & by mail.
Ask your question clearly with complete details. And include query what have you tried so far?
if you give example for returning values to the calling procedure it would be better
 
Share this answer
 
Comments
CHill60 18-Jan-14 10:46am    
To whom was this directed? Solution 4 gives an example of returning values to the calling procedures

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900