aesmike
asked on
Problem understadning Control Flow in SSIS
Im having a problem understanding how control flow works in an SSIS package.
I created a simple model using just Script tasks as my practice packagejust to make it as simple as possible.
Heres my observation:
Lets say I have a 3 tasks. First I have one called Task1. Below this I create two other tasks called Success and one called Failure. Using the designer, the green On Success line goes from Task1 to the Success task. The red On Failure line connects Task1 to Failure. I then edit the Task1 script so the last line reads:
Dts.TaskResult = Dts.Results.Success
When I run the package, As expected, the flow leads from Task1 to Success. If I edit the Task1 script so the last line reads:
Dts.TaskResult = Dts.Results.Failure
The flow leads from Task1 to the Failure task.
Again, this is all running as expected.
Now, I create an additional task called Task2. Its independent of Task1 and has no precedent. I have the script for Task2 return a Success result. Strangely, when I connect the red On Failure line from Task2 to the SAME Failure task that Task1 points to and run it, when Task1 fails it does NOT flow to the Failure task as it should.
Now, If I have Task2s OnFailure flow to its own failure task, everything works fine.
Can two or more tasks not flow into the same task?
example1.jpg
I created a simple model using just Script tasks as my practice packagejust to make it as simple as possible.
Heres my observation:
Lets say I have a 3 tasks. First I have one called Task1. Below this I create two other tasks called Success and one called Failure. Using the designer, the green On Success line goes from Task1 to the Success task. The red On Failure line connects Task1 to Failure. I then edit the Task1 script so the last line reads:
Dts.TaskResult = Dts.Results.Success
When I run the package, As expected, the flow leads from Task1 to Success. If I edit the Task1 script so the last line reads:
Dts.TaskResult = Dts.Results.Failure
The flow leads from Task1 to the Failure task.
Again, this is all running as expected.
Now, I create an additional task called Task2. Its independent of Task1 and has no precedent. I have the script for Task2 return a Success result. Strangely, when I connect the red On Failure line from Task2 to the SAME Failure task that Task1 points to and run it, when Task1 fails it does NOT flow to the Failure task as it should.
Now, If I have Task2s OnFailure flow to its own failure task, everything works fine.
Can two or more tasks not flow into the same task?
example1.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ahhhhh, thanks!
ASKER
Ooops, I may have jumped the gun on this being solved. I set the logic OR for the constraints and it still didn't fire. See Image below
ASKER
Geeze, never mind!
I had that failure step disabled!
Problem solved as you two suggested
I had that failure step disabled!
Problem solved as you two suggested
Yes, if you want the task to run based on either then change your constraint. Logical OR
logical-OR.bmp