SSIS global variable

16,198

Solution 1

SSIS has variables that can be global to a package, but to span multiple packages, I can think of the following options

Passsing Variables

Have Main Package define a variable and pass the value as a parameter to all packages that it calls. Call the variable the same name in all packages for easy identification.

Config File

Use the same SSIS configuration file across packages and store the value in there.

Environment Variable

Use a windows environment variable that is read from other packages

Registry Value

Store in Windows registry and read for each package - make sure you store under a tree that all packages can see otherwise you may run into permissions issues. Eg HKLM

Database Lookup

Store the value a table structure.

Solution 2

You can create local variables in your scripts. Any variable you create in a script is local just to that script. You can also create global variables (via the Variables slideout window) which can be scoped for the entire package, or a subset of the package.

Solution 3

You could use Package Configurations (using either a DB, XML file, environment file or registry setting) to hold these values and each of the 32 packages can reference the same configuration, rather than have to set up the variables in each package,

Share:
16,198
pramodtech
Author by

pramodtech

Updated on July 18, 2022

Comments

  • pramodtech
    pramodtech over 1 year

    Is there anything similar to global variable in SSIS? I have 4 variables (FromAddress, ToAddress,...) which will be used in all packages (32). So if I can set them only once it will be very easy to use in all packages and will save my time. Please advise.

  • cjk
    cjk almost 14 years
    And how does any of that address having a variable that is scoped across multiple packages?
  • Randy Minder
    Randy Minder almost 14 years
    @ck - I don't think he meant packages. I think he meant tasks. Just my guess.