Question

Background: Server1 has source db with 4 tables. Server2 is the destination db with those 4 to 5 tables (and some extra fields). We've a field mapping and some extra processing (i.e. truncate, concate, ..) before moving data from Server1 to Server2. We've 4 independent dtsx packages - one for each and there's an SQL job which calls each dtsx package in a sequence one by one.

Platform: SQL 2005 & SSIS 2005

Now, as you might guess each dtsx package will replicate a "source" and "destination" db connection in connection manager. When we change any setting in the remote destination db we've to change connection in each dtsx - what are the options to persist the remote db connection info at a single place?

Here're some I know -

  1. Create a parent dtsx that will call each of the 4 dtsx in sequence (same as done in job) and pass connection variable defined in this(parent) package(Example). But this would mean a single dtsx package step in the job which doesn't make it easy to debug in future (at present we can easily identify which step failed - so which table/dtsx has issues)

  2. A bit traditional but works - using database synonyms. We're already using synonyms for some remote tables in a data comparison SP. If I create 4 new synonyms - one for each remote table. I can refer those tables directly in dtsx by their synonym. Later in case of any change - I need to alter and re-run the script that will drop and re-create synonyms (I can do that remotely as well!)

I do simple dtsx designing and programming so pardon my knowledge and let me know the best approach.

Was it helpful?

Solution

What you are looking for is Package Configurations.

Basically, a configuration value is just a stored key/value pair of some property in SSIS (for example, your connection manager's connection string.)

You can store it in a number of formats (see the link) - I personally use XML files since I have a support team who handles deployment and they "get" files.

Then each package just references that XML file in its own configurations. When the package is run it will use the value of the connection string for that connection, so each package will use whatever's in the XML file (or whatever configuration format you choose.)

Basic steps:

  1. Create connection in package.
  2. Under SSIS -> Package Configurations, choose "Enable package configuration", choose "Add ..", choose the format you want, select the connection's connection string property, save the configuration.
  3. In the other 3 packages, go to the same area, choose "Add.." and this time browse to the configuration you created, it'll ask you to Overwrite the values in that configuration with what's in the package or Reuse Existing (meaning keep the value you already created) - choose Reuse Existing. Name it, save it.

Check the link out above for more info, it's what you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top