locked
OnError and OnPostExecute Event in SSIS RRS feed

  • Question

  • Hi All,

    I am having SSIS package with two DFT both of which run in parallel and have OnPreExecute, OnPostExecute and onError event written on them. Currently if any DFT fails, the onPostExecute doesnt stop, it also runs.

    I need to override this behaviour. So bascially, if DFT fails..i want just onError event to fire not the onPostExecute event and fail that particular DFT. Whole package shouldnt fail, the other DFT should continue running.

    Any help would be grateful.

    Monday, September 10, 2012 5:11 AM

Answers

  • When different events get fired in the implementation flow these are handled by the event handlers. However the outcome of the processing of these events does not afftect the main flow and you CANNOT override this product behaviour. So the answer to your question is you re-design your implementation such that the pre-execute, post-execute and error processing are a part of the main flow using control flows and precedence constraints.


    http://btsbee.wordpress.com/

    • Marked as answer by Eileen Zhao Monday, September 17, 2012 5:14 AM
    Monday, September 10, 2012 8:02 AM

All replies

  • You can't stop OnPostExecute from firing, as it says here: http://msdn.microsoft.com/en-us/library/ms140223.aspx

    "The event handler for the OnPostExecute event. This event is raised by an executable immediately after it has finished running."

    You may have to rethink what you're doing in those eventhandlers.

    hope that helps


    ObjectStorageHelper<T> – A WinRT utility for Windows 8 | http://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
    Jamie Thomson

    Monday, September 10, 2012 6:22 AM
  • Hi Jamie,

    Thanks for reply!

    The problem is with onPreExecute event as well. Suppose the onPreExecute fails, even then my DFT run. This is even more undesirable behaviour. Is there anyway to overcome this? I can fail the package, but that will make my second DFT stop.

    Any help?

    Monday, September 10, 2012 7:03 AM
  • all the task which you used in "onPreExecute " and "onPostExecute ", you can bring back to control flow [only for your this special case...] and control them with the help of precedence constraints. 

    let us know if you have any doubt.. 

    --


    Let us TRY this |


    My Blog :: http://quest4gen.blogspot.com/

    Monday, September 10, 2012 7:33 AM
  • When different events get fired in the implementation flow these are handled by the event handlers. However the outcome of the processing of these events does not afftect the main flow and you CANNOT override this product behaviour. So the answer to your question is you re-design your implementation such that the pre-execute, post-execute and error processing are a part of the main flow using control flows and precedence constraints.


    http://btsbee.wordpress.com/

    • Marked as answer by Eileen Zhao Monday, September 17, 2012 5:14 AM
    Monday, September 10, 2012 8:02 AM
  • hi prt33k, I know it's a bit late but if you just want to execute tasks in the OnError event but not the OnPostExecute, 

    you can have an error_flag variable and set to one in the OnError event. At OnPostExecute, put a dummy script task

    and Predicate which controls the flow. If error_flag = 1 (indicates there are errors ), then proceed to those real stuffs at OnPostExecute, otherwise, do nothing. 

      This is how I did to prevent from firing multiple error emails after setting up propagate values in the master sequence container.


    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Tuesday, March 14, 2017 6:32 PM