In SSIS how do I,
1) Pass a variable to the dtsx package.
2) How to us开发者_运维知识库e that variable to control branching to a particular data flow task.
Thanks
You can use a Data Flow Task + file and pass variables to the SSIS package at the time of execution through this file.
Check out this step by step tutorial as to how to achieve this
You can setup variables at the package level in SSIS from the SSIS --> Variables menu.
You have to do parameter mapping at a task level to then be able to pass those values to a specific tasks and use them in it.
Refer this link for a pretty detailed tutorial that explains with screenshots exactly how to do this.
You can use Script Tasks and Precedence constraints in order to control branching based on specific conditions of the variable
Refer this link for some screen images for how to set it up. As with everything in SSIS, one picture is worth a hundred words of mine
Config files (Package configuration) is the answer to "how to pass parameters to a package". You don't send a single parameter value but the file itself as a parameter and the file contains a detailed list of parameters and their respective values, in xml form. You have other options than the file like storing these parameters in DB table, environment variable etc...
Precedence constraints are the best and easiest option for controlling the control flow inside a package based on values stored in variables. Just double click on a control flow line (connecting different tasks) and set an SSIS expression to get this done.
Hate to answer on such an old post. I totally understand why you didn't mark any answers because I have the same problem and none of the answers helped.
My suggestion.
Add an Execute Sql Tast that doesn't do anything (like 'select 1')
have conditional branching and have both branches use a function branch based on the variable.
one for false
one for true
精彩评论