Dynamic Connection strings using XML config file

  • Hi all,

    I am currently working on a project to migrate all of our batch jobs (about 50 in all) from an old SQL 7 to SQL 2005. I am trying to make things as simple and reusable as possible so changing or creating new ones will be fairly easy. My intention was to create a config file that contained all of the connections that are used for our batch processing system and set up an indirect configuration using and environment variable. This way when our DBA migrates the packages she can decide where to put the config file when she does the install.

    Then I ran into an issue. I am getting errors when loading the package with the new configuration file and after lots of Google searches I discovered that if there is no connection manager for all of the configurations defined in the xml file it will generate an error. The package will still run but I am not comfortable with all of the errors every time I load the project. I really don't want to create separate config files for each of the projects it just seems nuts.....nor am I crazy about creating a config file for each connection since that number ranges in the 30's.

    Does anyone have any suggestions as to how this might be accomplished and point me in the direction of an example I might use to start with. I was trying to go down the path of using an expression to populate the connection string but I was unsure how to retrieve the information from an xml file using expressions or even if it is possible. I am open to giving anything a shot.

    Thanks in advance for your help,

    Judie

  • you can create a variable for each and every connection manager and store the value of the connection manager in the variable...now, in the expressions store the appropriate variables...in the xml configuration file, you will just change the value of the variable...it should work out...

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply