Problem with Event Handlers

  • Hello Folks,

    I am facing a weird issue with a Package.

    I have Package that has only one Task "Execute Process Task" ; I created 3 event handlers

    ( OnPreExecute, OnError, OnPostExecute ) for this Task as well as to the Package.

    So my the issue I am facing, whenever I execute the Package, Event Handlers (OnPreExecute and OnPostExecute ) of the Package are executing multiple times .......like

    On time when the Package Hits the PreExecute and Task in the Package Hits the PreExeute.

    The same thing is happening for PostExeute Event Handler also.

    How to make the EventHandler of the Package to be executed only onces when the respective event occurs.. Is there any option to apply the scope ??

  • The problem is that the events from the task propagate from the task itself to the package.

    This has the consequence that the event handlers are fired more than once.

    For example:

    package starts, the OnPreExecute event is fired.

    SQL task starts, the OnPreExecute event is fired, but this event also propagates to the package level, so the OnPreExecute event is also fired on the package level.

    One option is not to create package event handlers, but only event handlers on the tasks.

    Another, more viable option, is to use the Propagate system variable. If you set this one to false, the event handlers will not propagate. The concept is explained in this article: http://agilebi.com/jwelch/2008/01/15/handling-multiple-errors-in-ssis-revisited/

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (6/26/2011)


    The problem is that the events from the task propagate from the task itself to the package.

    This has the consequence that the event handlers are fired more than once.

    For example:

    package starts, the OnPreExecute event is fired.

    SQL task starts, the OnPreExecute event is fired, but this event also propagates to the package level, so the OnPreExecute event is also fired on the package level.

    One option is not to create package event handlers, but only event handlers on the tasks.

    Another, more viable option, is to use the Propagate system variable. If you set this one to false, the event handlers will not propagate. The concept is explained in this article: http://agilebi.com/jwelch/2008/01/15/handling-multiple-errors-in-ssis-revisited/

    Thanks Koen

  • this is by design, here is a quick workaround[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply