Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I run SQL at start and end of a package?

Status
Not open for further replies.

Mike3026

Programmer
Mar 4, 2009
2
US
I've created a SQL task that would run a stored procedure and insert a datetime into my database. I'd like to have the SQL task run at the start and end of a package. Where would I put the SQL Task to accomplish this goal?
 
In the Control Flow, you set the order of operations by connecting different tasks together by dragging the arrows and connecting the different tasks. So all you need to do is make sure the Execute SQL Task is either at the beginning or end of the chain.
 
As riverguy said create your work flow but add a second SQL task at the end of the workflow to execute the procedure at the end of the process.
 
Thanks for the suggestions.

I've thought about putting the "start" and "end" by using the control flow, but I'm wondering if there are "pre" and "post" type events that I could use, so that the control flow window is clean of the start and end items.

I hope what I just wrote isn't too confusing. Basically, I'd like the start and end logging to occur somewhere in the program but not in the control flow, so as simplifying the control flow window.

Thanks in advance for any suggestions.
 
There are OnPreExecute and OnPostExecute event handlers that you can use but I am not sure how they are executed if a package errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top