Click here to Skip to main content
15,887,347 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Executing a stored procedure within a stored procedure

EXEC SP1

BEGIN

EXEC SP2
END
But I only want SP1 to finish after SP2 has finished running so I need to find a way for SP1 to wait for SP2 to finish before SP1 ends.
Posted
Updated 28-Feb-13 20:22pm
v2
Comments
Just eg 1-Mar-13 2:25am    
convert SP2 to function

Hi,

You will Create SP2 with "OUTPUT" Parameter then While calling SP2 in SP1 get that Values and Check in SP1.

Regards,
GVPrabu.
 
Share this answer
 
By Using xp_cmdshell


DECLARE @result int
EXEC @result = xp_cmdshell 'EXEC SP1'
if @result = 0
Begin
    EXEC SP2
End
 
Share this answer
 

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