Event Handlers in SSIS(OnError & OnPostExecute)

  • Hi,

    I am using a SSIS package to write the records to the flat file destination. During this process I am using Event Handlers OnError and Onpostexecute events. The OnError Event Produces a Failure Trigger file in my work area if any task fails.The OnPostExecute event triggers a Success trigger file when the task is completed. When an error occurs in any task, the onError event will get triggered which produces a Failure Trigger file. but again the on post execute event get triggered which even produces the success trigger file.In this case, I am not able to figure out whether it is a Success trigger or Failure Trigger. As because the OnPostExecute Event fires after the OnError Execute.Can you please help in this.

  • I understood your problem, even i faced the same problem.

    Where i used to store the results of OnError, OnPreExecute and OnPostExecute in SQL tables.

    So whenever a task execution starts, first it will fire OnPreExecute then insert a record into to Package_Process_table then fire OnPostExecute to update the Package_Process_table.

    In between if an error comes then it will fire OnPreExecute, OnError and OnPostExecute.

    In such case, OnError i will update Package_Process_table with status as FAILED, OnPostExecute first i will check whether the status of package is STARTED or FAILED if it is FAILED then i dont update Package_Process_table on OnPostExecute.

  • Can you please tell me how you are checking for the status of the package?

  • If you check BOL, the OnPostExecute event fires after an executable finshes running. An error causes an executable to finish running.

    ____________
    Just my $0.02 from over here in the cheap seats of the peanut gallery - please adjust for inflation and/or your local currency.

  • I am not exactly understanding the solution you provided. Can you please elaborate.

    I am working on SSIS 2008 and I am having the same problem where a log gets entered from OnError as Error is task execution and there is another log where the OnPostExecute log says the task completed successfully. Is there way or a check I can add before OnPostExecute to see the status of job and then continue?

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

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