What connection string is SSIS using - sql-server

I have an old SSIS package built under 2008R2. Other devs have tweaked it over the years. When I open it and manipulate it I have an issue where it WILL NOT persist the password in the connection manager. Otherwise I can more or less edit it.
When I save the package and deploy just the dtsx file to a test server, it is using a connection to a different server. I've opened up the raw XML and find no references to that server. The only connection in the package points to the server it is supposed to use.
How do I figure out where it is pulling this phantom connection string from?

Most likely its stored as part of a package configuration which has many possible sources from a SQL or a separate XML config file. Check the command line options for a configuration option where you are executing the package to determine the source. Package configurations override the default values of parameters used in a package, and abstract environment specific values (conn strs, file paths, credentials,...) for easier testing/QA, without hard coding values.

Related

Is there any way to change the SQL Server name in Python code based on the environment?

In my Python script, I established the SQL Server DEV connection and I am calling this script in my SSIS package, so now I want to deploy the project on Production server.
Q: How SQL server connection should be changed to Production from Development automatically/dynamically without editing the script manually? Is there a way that it should get/read Production environment?
Please help me out with this, thank you.
sys.argv and pass it as a command line parameter.
Pull it from an environment variable value os.environ
Read from a config file with configparser
Without any sample code, it's hard to say what the right approach should be but I would favor a command line parameter as that allows you to provide the value from the SSIS package (instead of defining configurations in both SSIS space and python space)

SSIS package using SQL Configuration

I'm trying to convert my SSIS package from using a dtsConfig file to use SQL Server configuration (by accessing the [SSIS Configurations] table). I'm getting strange errors running from an Agent job when it worked just fine using the dtsConfig file with the same parameters selected for the config. I'm not sure about whether I need to select the data sources. I don't need to include data source information with dtsConfig to get it to run. Including connection string information is adequate for dtsConfig. I'm not sure how it knows how to connect to SQL to look for the config info.
Is there a trick to this? Do I need to tell Agent to use SQL configuration? I removed the dtsConfig file, but I don't see anywhere to tell it to use SQL config.

ssis xml configuration modifies package xml - am i crazy?

Can SSIS XML configuration actually alter the contents of a package?
I created a set of packages connecting to my local machine, and ran it.
Then i created XML configurations
then i modified dtsconfig XML , changing the DataSource in the ConnectionString and the ServerName as well to a second server.
i was getting login errors so i viewed the code of my packages. the connection managers in the packages now had the second server, not the localhost connection i had coded in the package. I am absolutely certain that i did not modify the connection managers in the package, only the configuration.
So my question is, can SSIS configurations change the package itself?
If you specify a config file at design time, then run your package, the properties of your design-time objects will be updated (in your design-time package) to the values specified in your config.
If you then save your package, it will be saved with the updated property values.

How to transfer a ssis package from Dev to Prod?

I'm trying to move my packages to production using a configuration file, but file is changed only partly and the results go still to DEV server.
Does anybody know what to do?
It is difficult to isolate the cause of your issues without access to your configuration files.
What I suggest you do is make use of package configurations that reference a database within your environment. The databases themselves can then be referenced using environment variables that are unique to each environment.
This a brilliant time saver and a good way to centrally manage the configuration of all your SSIS packages. Take a look at the following reference for details.
http://www.mssqltips.com/tip.asp?tip=1405
Once configured, you can deploy the same identical package between dev and production without needing to apply a single modification to the SSIS package or mess around with configuration files.
You could still have hard-coded connections in your package even though you are using a configuration file. You'll need to check every connection as well.
You can also go the long way around. Go into Integration Services and Export the stored package to its dtsx file. Then you can pull open the file in any good text editor, do a find/replace on your server name and then go back into Integration Services and Import the updated package. Alot of times it's just easier...
everybody and thanks for answering. I'd managed to solve this problem in an ugly way - editing packages on server, but I'd like very much more elegant solution - now I'm trying with environment variable,it seems great, but the wizard that I'm getting is different from that is given in link - and I don't know how to continue.(I'm using VStudio 2005) Besides, I tried configuration file as XML, but package run fails even on the source machine, so I'm stuck !
My personal technique has been to first have a single config file that points the package to a SQL Based Package Config (the connection string to the config DB). Subsequent entries in the package config use the SQL store to load their settings. I have a script that goes into the XML of the package and preps them for deployment to stage or prod. A config file holds the name of the Package Configuration's initial file config entry and where the stage and prod configuration db configruation file is located. The script produces two subdirectories for stage and prod. Each directory has a copy of the solution packages modified for their particular deployment.
Also! Don't forget to turn off encryption in the package files!

How do I use a different database connection for package configuration?

I have an SSIS Package that sets some variable data from a SQL Server Package Configuration Table. (Selecting the "Specify configuration setings directly" option)
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.
All the other Connections take up the correct connection strings, it only seems to be the Package Configuration that reads from the wrong place.
Any ideas or am I doing something really wrong?
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.
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.
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.
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.
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.
If u are using SQL Server Package Configuration then all the properties of the packages will come from SQL Server table - Please check that
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?
Goto the package properties and set deployment True. This should work for what you have done.
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.
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 SQL Server Central [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.
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.
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.
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.
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)
Looks Like when you run an SSIS package as a step in a scheduled task it works in this order:
Load each of the Package Configs in the order they appear in the Package Configuations Organiser
Set the Connection Strings from the Data sources tab in the Job Step properties of the Scheduled Job
Start running package.
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.

Resources