<p>I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the "Specify configuration setings directly" option)</p>

<p>This works well when I'm using the Database connection that I specified when developing the package. However when I run it on a server (64 bit) in the testing environment (either as an Agent job or running the package directly) and I Specify the new connection string in the Connection managers, the package still reads the settings from the DB server that I specified in development.</p>

<p>All the other Connections take up the correct connection strings, it only seems to be the Package Configuration that reads from the wrong place.</p>

<p>Any ideas or am I doing something really wrong?</p>

[{'answer_id': 38909, 'author': 'Jon Limjap', 'author_id': 372, 'author_profile': 'https://Stackoverflow.com/users/372', 'pm_score': 2, 'selected': True, 'text': '<p>The only way I was able to do this was to use Windows Environment Variables. You can specify things like connection strings and user preferences in environment variables, and then pick up those environment variables from your SSIS Task.</p>\n'}, {'answer_id': 39489, 'author': 'baldy', 'author_id': 2012, 'author_profile': 'https://Stackoverflow.com/users/2012', 'pm_score': 1, 'selected': False, 'text': '<p>I prefer to use Server Aliases in the SQL Client Configuration.  That way, when you decide to point the package to another SQL Server it is as simple as editing the alias to point to the new server, no editing necessary in the SSIS package.  When moving the package to a live server, you need to add the aliases, and it works.</p>\n\n<p>This also helps when you have a real painful naming convention for servers, the alias can be a more descriptive name than the actual machine name.</p>\n'}, {'answer_id': 41396, 'author': 'Malik Daud Ahmad Khokhar', 'author_id': 1688440, 'author_profile': 'https://Stackoverflow.com/users/1688440', 'pm_score': 1, 'selected': False, 'text': "<p>I didn't actually understand your question completely but I store my connection settings in a configuration files usually one for each environment like dev, production etc. The packages read the connection settings from the config files when they are run.</p>\n"}, {'answer_id': 50942, 'author': 'KiwiNige', 'author_id': 2375, 'author_profile': 'https://Stackoverflow.com/users/2375', 'pm_score': 0, 'selected': False, 'text': '<p>We want to keep our package configs in a database table, we know it gets backuped with our other data and we know where to find it. Just a preference.</p>\n\n<p>I have found that to get this to work I can use an environment variable configuration to set the connection string of the connection manager that I am reading my package config from. (Although I had to restart the SQL Server agent before it could find the new environment variable. Not ideal when I deploy this to Production)</p>\n\n<p>Looks Like when you run an SSIS package as a step in a scheduled task it works in this order:</p>\n\n<ul>\n<li>Load each of the Package Configs in the order they appear in the Package Configuations Organiser</li>\n<li>Set the Connection Strings from the Data sources tab in the Job Step properties of the Scheduled Job</li>\n<li>Start running package.</li>\n</ul>\n\n<p>I would have expected the first 2 to be the other way around so that I can set the data source for my package config from the scheduled job. That is where I would expect other people to look for it when maintaining the package.</p>\n'}, {'answer_id': 151664, 'author': 'thursdaysgeek', 'author_id': 22523, 'author_profile': 'https://Stackoverflow.com/users/22523', 'pm_score': 1, 'selected': False, 'text': "<p>When you're creating a job to call the SSIS package, and you're setting up the step, there is a tabbed area.  The default tab is where you set the package name, and the next tab over is where you can set the configuration file.  Have a config file for each package, and change for the server (dev, test, prod).  The config file can be put directly on the dev, test, and prod servers, and then point to them when setting up that job.</p>\n"}, {'answer_id': 250370, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>SSIS security the way it stands is terrible.  No one will be able to support things when I am out of the office.  The job never reads from the configuration file...I give up.  It only works when I edit the string in the Data sources tab.  However the password gets lost if you happen to go into the job a second time.  Terrible design, absolutely horrible.  You would think that when you specify a xml file in the job step it would read the connection string from there that is defined, but it does not. Does this really work for anyone else?</p>\n'}, {'answer_id': 417580, 'author': 'user46795', 'author_id': 46795, 'author_profile': 'https://Stackoverflow.com/users/46795', 'pm_score': 0, 'selected': False, 'text': '<p>Goto the package properties and set deployment True. This should work for what you have done. </p>\n'}, {'answer_id': 1192166, 'author': 'Joon', 'author_id': 139200, 'author_profile': 'https://Stackoverflow.com/users/139200', 'pm_score': 0, 'selected': False, 'text': '<p>I had the identical question, and got the same answer, i.e. you cannot edit the connection string used for package configurations hosted in SQL Server, except if you specify that the SQL Server connection string should be in an environment variable.</p>\n\n<p>This unfortunately does not work in my dev setup, where two environments are hosted on the same machine. I ended up following Scott Coleman\'s approach as detailed on <a href="http://www.sqlservercentral.com/articles/SSIS/66426/" rel="nofollow noreferrer">SQL Server Central</a> [Free sign-up and a good site]. The trick is that you create a view to store your configuration settings on one central server, and then use the machine that connects to it to determine which environment is active.</p>\n\n<p>I used that approach, but also used the User connecting to the environment to make a determination, because my test and dev setups run on the same SSIS instance, but as different user names. Scott suggests in the comments that the application name should be set, but this cannot be changed in the package execution job step, so it was not an option.</p>\n\n<p>One other caveat that I found was that I had to add "Instead of" triggers to my view to do the inserts, updates and deletes for configuration variables.</p>\n'}, {'answer_id': 4194329, 'author': 'Rajeev Kumar Mehta', 'author_id': 399079, 'author_profile': 'https://Stackoverflow.com/users/399079', 'pm_score': 1, 'selected': False, 'text': '<p>If u are using SQL Server Package Configuration then all the properties of the packages will come from SQL Server table - Please check that </p>\n'}]
['https://Stackoverflow.com/questions/38766', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2375/']