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:37pm

Yeah, I said in my original post that my package raised two errors, not four as I thought it might. Again, the set up was, I have an event handler defined at the package level, the package has one sequence container with 3 exec sql tasks. 2 of the 3 exec sql tasks were set up to fail. When I ran the package, the 2 exec sql tasks failed, failing the sequence container, and finally failing the package. But the event handler only seemed to capture the errors at the 2 exec sql tasks. So again, if this is not what is expected, is that because there is some setting I am overlooking or did I miss something in my event handler set up?
Free Windows Admin Tool Kit Click here and download it now
July 1st, 2012 5:30am

Hi D00linDalton, This is expected. If an event has no event handler, the event is raised to the next container up the container hierarchy in a package. If this container has an event handler, the event handler runs in response to the event. If not, the event is raised to the next container up the container hierarchy. You defined the event handler at the package level, when exec sql task failed, the event is raised to the package hierarchy. For more inforamtion about Integration Services (SSIS) Event Handlers, please see: http://msdn.microsoft.com/en-us/library/ms140223.aspx Thanks, Eileen
July 5th, 2012 5:03am

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

Other recent topics Other recent topics