Problem understadning Control Flow in SSIS

Posted on 2009-02-22
Last Modified: 2013-11-10
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?

Question by:aesmike
    LVL 25

    Accepted Solution

    This is the expected behaviour.

    When you have two separate tasks flowing to a common target, both of them become precendence constraints to this target and the target task will execute only if both the sources execute with the targeted result to pass control to this target.

    LVL 17

    Expert Comment

    >Can two or more tasks not flow into the same task?
    Yes, if you want the task to run based on either then change your constraint.  Logical OR

    LVL 10

    Author Comment

    ahhhhh, thanks!
    LVL 10

    Author Comment

    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
    LVL 10

    Author Comment

    Geeze, never mind!
    I had that failure step disabled!

    Problem solved as you two suggested

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard ( is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now