tags:

views:

18

answers:

1

Hi,

How do I execute an SSIS Package based on a flag bit present in a table.

What I understand is, we need to create a variable and then get it assigned with the value in the SQL Server Table.

And then use the precedence constraints to control the flow.

If my flag bit is "0" I will run it and make it 1 at the end, but if it "1" I should not be running the package but still my package should be completing with Success

How do I accomplish this?

A: 

You can run an Execute SQL task to get your value from the SQL Server table. The value can be assigned to a variable in the task. The Execute SQL task should be the first task to run.

Create a Precedence Constraint from the Execute SQL task and the task that will run if the flag bit is set to run. You can do this by selecting the Execute SQL task and dragging the green arrow to the next task.

Right-click on the new Precedence Constraint line and select Edit. In the Constaint Options panel, set the Evaluation Operation to "Expression and Constraint". Leave the Value option as "Success". Enter @[MyVariable] == 0 in the Expression field, where MyVariable is the name of the variable that contains the flag bit value.

When the package runs, it will stop if the conditions in the Precedence Constraint are not met.

bobs
thanks bobs,I have implimented it and thats working.
Queue

related questions