views:

414

answers:

1

I have a SSIS package with a control flow containing a bunch of execute sql tasks in a sequence.

I need to check a flag for each of the tasks and run the task if it is set, if not skip and go to the next one.

Each of the these task executes a stored proc. So i can check in the proc and "Return" if not set. I was looking for a "SSIS" solution if any.

TIA

PS

+5  A: 

Between your control flow tasks, click on the arrow and choose Edit. When you do this, you get a dialog that allows you to check the "constraint" (success, completion or failure) of the task, an "expression" (i.e. you can have your execute sql task return a value, store that value in a variable, and check the value of that variable in an expression to determine whether to continue down the path you are editing), an "expression and a constraint", and an "expression or a constraint". These last two are the same except for the logic. "Expression and constraint" requires a true condition on both the expression and the constraint, "expression or constraint" requires a true condition on only one of the expression and the constraint.

William Todd Salzman
I just have one path. And the steps in that path need to check a flag, if not set then go to the step in the path. IS that possible with "constraint"?
ps
No, Constraint only checks the execution status of the task its input is connected to. If the task Succeeds, then constraint test will be true if set to Success, if the task fails, then constraint test will be true if set to Failure, Constraint is true whenever the task completes if set to Completion. You want Expression. In your stored proc, return your flag value as output. Put that output into a variable. In your path use Expression and test that variable against your condition. If true the path will pass to the next step in your flow.
William Todd Salzman