Developing Matt

My Technical Journal

Posts Tagged ‘onpostexecute

Package Event Handler

leave a comment »

A package level event handler is not just an event handler for the package. It is also an event raised for each executable inside the package.  Restated: if you place an event handler and place it at the top node (at the package level) this will occur for your package and every executable inside of it.

The problem: I thought that I could throw an insert to a table to discover when my package completed. To do this …at the package level……I set the ‘on post execute’ handler to include an insert statement with the end time. However, it inserted twice (when there was only one object). Once for the object, once for the package.

The solution: I created a constraint (from an empty container) with a test on the variable System::SourceParentGuid. When it is empty, I know that it is not coming from a parent executable, and from the package only.  The constraint was @SourceParentGUID==""     Now my insert will only execute on post execute when there isn’t a source parent GUID. 

 

constraintonParent

Written by matt

August 10, 2012 at 8:19 am

Posted in SSIS

Tagged with