selectively execute task in ssis control flow

ps. picture ps. · May 10, 2010 · Viewed 53.7k times · Source

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

Answer

Amos Wood picture Amos Wood · Sep 9, 2011

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.