I have a package with an OnError event handler which records the failure in a database table. This is all working fine but looking at the "All Executions" report, the status is "Succeeded". This has the effect that the SQL Agent job which runs the package is also succeeding. Consequently no failure notification is raised by the job.
Can anyone advise how I can retain the OnError functionality but have the package actually fail?
What is the maximum error count set to on the package?
If its set to 100 but only 99 errors are raised, its below the threshold so will report as a successful run even though it had errors.
May 20, 2021 at 8:10 am
Grrr... Such a simple answer! For some reason I'd set it to 0.
Many thanks.
May 20, 2021 at 8:11 am
I would have expected it to report a failure in that case, but to be brutal you could add a Script Task to your OnError handler which does this:
public void Main()
{
//Fail the package
Dts.TaskResult = (int)ScriptResults.Failure;
}
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply