I have two Data Flow tasks where only 1 of the 2 will execute. After either of these execute I want an Execute SQL Task to execute. When I have a green from each data flow task going into the execute sql task, the execute sql task does not get executed. The data flow task completes successfully but execution never makes it to the Execute SQL Task. Can you only have one green arrow (success) going into a task? Thanks
2 Answers
By default, two tasks are constrained by the Constraint of Success. That is, the first thing must generate a success value before the second thing will get the signal to start.
You have a binary set of Data Flow Tasks feeding into a single Execute SQL Task. The Execute SQL Task is waiting for both to finish. That's not going to happen so you must change the constraint.
The simple way to do this is to double click on the line connecting the Data Flow to the Execute SQL, doesn't matter which, and change the Precedence Constraint from a "Logical AND" to a "Logical OR". This allows the Execute SQL Task to run if either Data Flow generates a Success.
The Biml construct for creating the Or constraint appears as follows. I specify in the PrecedentConstraint a LogicalType of Or
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Packages>
<Package Name="so_28463621">
<Tasks>
<Dataflow Name="DFT 1"></Dataflow>
<Dataflow Name="DFT 2"></Dataflow>
<Container Name="OneOrTwo">
<PrecedenceConstraints LogicalType="Or">
<Inputs>
<Input OutputPathName="DFT 1.Output"></Input>
<Input OutputPathName="DFT 2.Output"></Input>
</Inputs>
</PrecedenceConstraints>
</Container>
</Tasks>
</Package>
</Packages>
</Biml>
