How to run a component with an optional multi-input?

  • I'm trying to execute a package with two different branches.

    What I'm trying to implement is something like the image which I hope to be self-explanatory.

    The package executes a bunch of common actions, like loading flat files on a staging table, drop indexes, an so on.

    Before moving that data for a target database, I need to decide wether I should backup or not.

    Now, I do a backup (or I don't), and after that I continue on a common path doing everything else (on "Perform, other tasks", and "perform a bunch of other tasks)

    Note that the blue arrows are defining a precedence for "Expression and Constraint" where Constraint is "Completion" and expression is @[DoBackup] == 1 for one branch and the same Constraint with expression @[DoBackup] == 0 for the other.

    The problem is that the job finishes (do not throw any kind of error) before it executes the "Perform other tasks" SQL task element, either performing backup or not.

    The last executed component when @[DoBackup] == 1 is "Perform Backup"

    The last executed component when @[DoBackup] == 0 is "DoBackup?"

    I notice that if I delete one of the blue paths the package executes all the components until the end.

    So, it looks to me that when I have both input paths (blue arrows) the component never executes because it receives only one of them.

    Can anyone help me to find a work around for this? :unsure:

  • You need a logical OR on those precedence constraints.

    Have a read here[/url] for examples.


  • Phil Parkin (1/20/2012)


    You need a logical OR on those precedence constraints.

    Have a read here[/url] for examples.

    Thank you for the tip.:w00t:

    And the pointed article is also excellent. 😀

  • My pleasure - thank you for the feedback.


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply