user2240715
user2240715

Reputation: 113

SSIS On Error Event Handler sending multiple emails on error

I have set up a Script Email task as part of the OnError Event Handler in a SSIS package. But on error the event handler sends multiple emails. Understanding the reason of that I tried to implement the solution suggested in the following thread but that is not working for me. I am having an issue similar to one of the commentators where condition @[System::SourceID]== @[System::PackageID] always evaluates to False so no email is being sent out at all now instead of multiple ones. I am using SQL Server 2012.

SSIS send email on error sending multiple errors

PS: I could not add comment to this thread due to lack of reputation points, so I had to start a new one.

Thanks, KK

Upvotes: 1

Views: 4633

Answers (2)

Joost
Joost

Reputation: 1913

I always use @[System::SourceName] == @[System::PackageName] enter image description here Enlarge

Upvotes: 0

Daryl Wenman-Bateson
Daryl Wenman-Bateson

Reputation: 3939

The way I have resolved the multiple exception issue in the past is

  1. Only raise email / log errors from master packages
  2. Add ErrorCounter variable and set to zero
  3. Inside the OnError handler increase the on error count by 1
  4. Add a precedence constraint expression @[User::ErrorCounter]<=1
  5. Send email or log error from that precedence constraint

that way you will only record one error per set of parent / child package failures

Upvotes: 2

Related Questions