Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
554 views
in Technique[技术] by (71.8m points)

ssis - 2 Data Flow Tasks Linking to one Execute SQL Task

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

enter image description here

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...