tags:

views:

22

answers:

3

In SSIS how do I,

1) Pass a variable to the dtsx package.

2) How to use that variable to control branching to a particular data flow task.

Thanks

A: 

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

InSane
A: 

@In Sane gave you good advice. Additionally, if you are running a SSIS package from a job, then you can set parameters in the Set values tab of the job step.

Registered User
A: 

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.

Faiz

related questions