Event Handler Example And Some Questions
I have a package that has a Sequence Container. In it are 3 Exec SQL Tasks that do some simple TSQL Commands. Two of them will produce errors and one will be successful. On this package, I have an Event Handler created at the package level for OnError event. In there, I have an Exec SQL Task to insert these system variables to an error log table. System::PackageName, System::SourceName, System:ErrorCode, System::ErrorDescription When I execute the package, the two Exec SQL Tasks fail, thus failing the Sequence Container, and the Package. This resulted in 2 lines being inserted into the error log table, one line for each of the failing Exec SQL Tasks. (I guess this means there were 2 OnError events that happened?) Is this what you would expect? I thought there will be 4 lines inserted into the log. 2 for each of the failing Exec SQL Tasks, 1 for the Sequence Container, and 1 for the Package. I'm thinking this because I thought the errors float upward from the inner to the outter containers. Here is a picture of what the Executable Hierarchy looks like, if this helps. (Also, in this picture, what am I supposed to see in the "Event Handler" folder? In my package, I have the event handler defined at the package level, but I don't see anything in the Event Handlers folder under the package name.)
June 27th, 2012 6:40pm

when you are working with Event handlers in SSIS you should be careful about Event Hierarchy; yes there will be 4 records logged; because ; Exec Task 1 Fails Exec Task 2 Fails Sequence Container Fails Package Fails when you set event handler on package level (which is the most parent level) you will get event raised for each executable in package tree. so if you want to just catch each Exec SQL task just set event handler for each task individually. this image shows how Event Hierarchy works in SSIS: you can use this link for more information about it: http://msdn.microsoft.com/en-us/library/ms140223.aspxhttp://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
June 27th, 2012 7:27pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics