SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Event Handlers in SSIS(OnError & OnPostExecute)


Event Handlers in SSIS(OnError & OnPostExecute)

Author
Message
dhanasekar.palani
dhanasekar.palani
SSC Rookie
SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)

Group: General Forum Members
Points: 49 Visits: 175
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.
vidyasagar.kunta
vidyasagar.kunta
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 63
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.
sharath_s93
sharath_s93
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 27
Can you please tell me how you are checking for the status of the package?
lshanahan
lshanahan
SSChasing Mays
SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)SSChasing Mays (614 reputation)

Group: General Forum Members
Points: 614 Visits: 436
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.
sharath_s93
sharath_s93
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 27
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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search