selectively execute task in ssis control flow

I think your question was the same as mine in which I wanted to control execution of a task "inline" in my control flow.

The easiest way that I have found doesn't involve expression on the data connectors between the control flow objects but rather using expressions on the control object itself and setting the "Disable" value using an expression. This way on execution, the object is either skipped or not based upon the expression evaluation.

As an example, I wanted to execute a "Execute SQL Task" to remove my indexes based upon whether a variable named "ExtractType" was equal to "Full". If it was then I wanted to remove the indexes on my tables before doing my full load.


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.