July 31, 2009 at 5:49 pm
Hello, I am a SSIS 2005 newbie. Does anyone know how can I reuse a task? Below is a simplified example of what I want to accomplish.
I have 3 tasks with success constraint link executed in the following order :
Script Task 1 -> Script Task 2 -> Email Script Task
If Task 1 and Task 2 is successful, Email Script Task will run fine. Now, I also want to execute Email Script Task if Script Task 1 fails. If I add a failure constraint link from Script Task 1 to Email Script Task, Email Script Task will not run because both condition of Script Task 1 failing and Script Task 2 succeeding has to be true which is not possible.
The only method that I have success with is to 1) create a duplicate Email Script Task 2 for the failure constraint or 2) create a new package and "pass" the parameters. Method 1) is so ugly that it's not practical in a real world. Method 2) requires a little more work than necessary.
Is there a way that I can reuse Email Script Task for different constraints? Also, how do I create a global function? I have common functions that should be accessible by all script tasks.
Any input would be appreciated. Thank you.
yien
July 31, 2009 at 6:09 pm
itzfake (7/31/2009)
I have 3 tasks with success constraint link executed in the following order :Script Task 1 -> Script Task 2 -> Email Script Task
If Task 1 and Task 2 is successful, Email Script Task will run fine. Now, I also want to execute Email Script Task if Script Task 1 fails. If I add a failure constraint link from Script Task 1 to Email Script Task, Email Script Task will not run because both condition of Script Task 1 failing and Script Task 2 succeeding has to be true which is not possible.
Right-click on one of your constraints and click Edit.... In the lower half of the Precedence Constraint Editor dialog box, there is a section for Multiple Constraints. Change the setting from Logical AND to Logical OR and it should work as you are expecting.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
July 31, 2009 at 7:07 pm
Thank you Drew!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply