Reputation: 6270
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.
Upvotes: 11
Views: 19638
Reputation: 32481
Using package configuration, you can simply do it. There is a great answer by @RodWall
https://stackoverflow.com/a/35069635/1468295
Upvotes: 0
Reputation: 48016
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.
Upvotes: 15
Reputation: 3008
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,
Upvotes: 1
Reputation: 46425
You can use a configuration database to retrieve values like that across multiple packages.
Upvotes: 0
Reputation: 48402
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.
Upvotes: 1