Stored procedures have return values. In the parent sp check for a successful return value and end it in an if statement.
You can use a technique like this to do this.
<pre>
CREATE PROCEDURE YourParentPRoc
AS
DECLARE @retValue INT
EXEC @retValue = YourChildProc
IF @retValue <> 0
return(0)
/*
More code goes after the return.
*/
END</pre>
This will run the child procedure and if the return value is not 0 it will stop the parent. Any code after the return does not get run if the @retValue <> 0 is true.
Last Wiki Answer Submitted: April 8, 2009 8:40 pm by mshen27,310 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You might want to explain further what you need to accomplish.