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.
CREATE PROCEDURE YourParentPRoc
DECLARE @retValue INT
EXEC @retValue = YourChildProc
IF @retValue <> 0
More code goes after the return.
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.