Update connection String for SSIS

  • I have SSIS package scheculed as a job and runs 2 am every night on production.

    We want the same ssis package to run on Dev, QA, as well as production; therefore we want to update the connection string dynamically.

    what is the best way to do it

    Thanks,

  • Read up on package configuration. It's intended to be use for situations like this.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • THe short answer is Package configurations. Now the more tricky question is where to store them, there are several choices:

    1. XML file

    2. Environment variable

    3. Registry

    4. A Table in SQL

    There is a 5th one but in this context it is not applicable, it is Parent package variable, which can be used for chained package execution where one package calls another and passes it some run-time information.

    I personally tend to try and stay away from environmental variables, I think they are harder to use and really don't provide much benefit.

    So, given all that, I recommend #1, the XML file. I chose a location that is common on all my servers such as C:\SSISConfig and use sub directories to segregate off config files for different projects or processes..

    Clear?

    CEWII

  • Thank you all, I will be doing it with XML file

  • As I said I was using xml file configuration to make my package portable; but I an facing a problem

    the connection string property of the OLE DB connection manager is not being pulled from the xml file I defined. It uses the the connection I had specified during design time.

    How do I force the SSIS package to use the configuration specified in the xml file.

    I've been spending a lot of time on this with no success. Please help..

  • Take a good look at what you have done. What you are saying should not be happening.

    Check to see if you have anything (tasks or expressions) that assigns the connection string after the package starts. That will overwrite the affect of the configuration file.

    Check that the configuration file actually has the connection information for that connection manager.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I agree, if the config file contains the connection information and the package configuration is configured to use the file it WILL use them, that is what forces it too..

    CEWII

  • I've not had problems with config file not being used. Just make sure that on top of creating the config file while editing the package, that you also choose that configuration file to be used when you set the job to run in the Agent.

    For ease, you may even create 3 different config files and schedule the package to run back-to-back-to-back each time using a different config and see what kind of results you get from that.

  • washawgolla (7/28/2009)


    As I said I was using xml file configuration to make my package portable; but I an facing a problem

    the connection string property of the OLE DB connection manager is not being pulled from the xml file I defined. It uses the the connection I had specified during design time.

    How do I force the SSIS package to use the configuration specified in the xml file.

    I've been spending a lot of time on this with no success. Please help..

    The package configuration is applied at the time the package is loaded. Therefore if you are designing your package and you edit your configuration file, or you change the specified file in your package, you will need to close the package and re-open it.

    John

  • I am faced with a situation where there are around 200 packages currently running in production but they all have hard-coded connection managers. Now they want to create configuration files for all of them. Is there a way to do this without opening each package? I have been googling this but have yet to come across any solution. Any help would be greatly appreciated.

  • aye_taur (9/15/2009)


    I am faced with a situation where there are around 200 packages currently running in production but they all have hard-coded connection managers. Now they want to create configuration files for all of them. Is there a way to do this without opening each package? I have been googling this but have yet to come across any solution. Any help would be greatly appreciated.

    aye_taur ,

    You should have started a new thread for your question.

    I hate to tell you, but the only way you might be able to do this without opening each package is by using some external program that is designed for this. I can't say I know of any. Check codeplex.com for such a program.

    Good luck and let us know if you find a program that can help.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • You could write VB.NET script\script task to read from db and update the connection string dynamically.. would this solve your problem?

  • Easier and cheaper to get an IT-literate temp in for a week, I reckon.

    Sometimes the development effort for a one-off task such as this just isn't worth it, IMO. But sometimes the lure of learning something new is irresistible, regardless of cost/benefit 🙂

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 13 posts - 1 through 12 (of 12 total)

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