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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Raising Error From ExecuteSQL Task

Status
Not open for further replies.

Roebuck

Technical User
Apr 23, 2003
14
0
0
GB
I have an ExecuteSQL task which calls a stored procedure then follow a success or fail path depending on the outcome.

I need the stored procedure to make a few simple checks against data, and if the data is bad/missing, exit and raise an error.

The DTS ExecuteSQL Task should then follow the Fail workflow.

To raise the error in the SP I have used:
RAISERROR( 'ErrorMessage', 16, 1 )
RETURN

But even when I force the SP to fail and raise an error the DTS ExecuteSQL Task will never follow the fail workflow.

Does anyone know how to make this work?
Thanks in advance.
 
Do you have your batch broken up with "GO" statements?

I seem to remember from another thread that when someone split their batch job up with GOs, the correct workflow path was chosen.

Hope this helps,
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top