February 4, 2009 at 10:59 pm
Hey all,
I'm trying to figure out how to somehow link the server and database name of a Data Source (existing in the solution explorer window of BIDS) to the server and database name used in the connections present in the connection manager window. I have several packages that all reference the same databases but will need to be executed at different times. The reason for the link is that I'm currently working in the development environment and want to be able to update all of the connections at once when moving to production. I think it would be better to store this information as an environment variable and read it from there, but the client has been fussy about changing/adding any settings on the servers where the data exists.
Here's a bit more drawn out example if it helps:
Solution Explorer:
Data Sources
DWH_Staging.ds
JEDB.ds
Packages
Groups.dtsx
ItemProduct.dtsx
Site.dtsx
Relational.dtsx
Transaction.dtsx
...
In each package I have two OLE DB connections in their connection manager; each pointing to one of the databases described in my Data Sources. When I move to production, I would prefer to just update my data sources that are project-wide (harder to miss one if there is only one) and have the package connections update at the same time. Both data sources point to SQL Server 2005 instances.
Thanks for any help,
Matt
February 4, 2009 at 11:43 pm
Just edit the Connection objects in each of the packages to have a Data Source ID of 'DWH_Staging' or 'JEDB' to create the link. Change to the Data Source will change the connection (and vice versa).
Phil
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
February 5, 2009 at 12:21 am
Thanks so much. Worked like a charm.
April 7, 2011 at 11:14 am
It sounds like you should be using package configurations.
First, I would set up a standard set of package-level variables with the same naming convention in each package. These will be your "Source Server" and "Source Database."
Next, use the Expressions in the Connection Manager's property sheet to assign the variables to the Connection Manager's server and database properties. (For OS file connection managers [flat, Excel, etc.], set the "connection string" property directly from the variable.)
Finally, set up package configuration(s) to set the package variables. You can use a file-based configuration file-based for this, and then you deploy the same package with server-specific configuration files.
I use the variables because (a) easier to set variable values, (b) one variable may set multiple connection managers, and (c) its easier to use consistent names and reuse configuration files for multiple packages.
In BIDS, the package configuration is part of the SSIS Project and gets used automatically. When you deploy to the server, you need to specify when you run a package that it needs the configuration files applied and where to find them; otherwise it will work with whatever default settings are in the package. A SQL Agent SSIS job step makes it relatively easy to specify the configuration file.
You can also use multiple configurations with a package, and multiple types. So, for example, you can have one permanent environment variable on the server that specifies the "data source" for a connection manager that is used for "SQL server table" package configurations. [You might also be able use "(localhost)" for servername here instead of an environment variable.] All the package-specific and volatile settings are in that SQL Server table. If you need e-mail (SMTP configuration managers), these could be single share configuration file where the server admins can maintain it. If you pick the right combination, you should be able to keep everyone reasonably happy.
David Lathrop
DBA
WA Dept of Health
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply