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

How do I fail a whole package depending on a return value

Status
Not open for further replies.

PreacherUK

Technical User
Sep 26, 2002
156
NL
a return value from an sp?

The sp checks that some values from tables equal each other. if the numbers equal then the results of an analysis package are correct. I then truncate a table. However if the numbers do not match to within a tolerance I want the truncate skipped (which I've done) but then I want the rest of the package that called the sp to fail or at least register as a fail as the sp is the last step in the package.

Any way of doing this?
 
If you use RAISERROR within an Execute SQL Task you can pass control to the "on failure" path of a DTS package. I'm not sure what error value tips the balance, 1 does not, but 16 certainly does.

example:

[tt]if (condition)
begin
RAISERROR ('This is a test', 16, 1)
end
[/tt]



Code:
|_ |_  _  | _  _
|, | )(/, |(_)| )
          '
 
sorry about this post, I had thought I had replied to an existing post :/

Thanks for the response, I'll look into this and update tomorrow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top