Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data Source Project Object Expand / Collapse
Author
Message
Posted Wednesday, February 4, 2009 10:59 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 1, 2013 10:59 AM
Points: 118, Visits: 223
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
Post #650574
Posted Wednesday, February 4, 2009 11:43 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:12 AM
Points: 5,259, Visits: 12,195
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



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #650584
Posted Thursday, February 5, 2009 12:21 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 1, 2013 10:59 AM
Points: 118, Visits: 223
Thanks so much. Worked like a charm.
Post #650594
Posted Thursday, April 7, 2011 11:14 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, November 21, 2014 6:18 PM
Points: 86, Visits: 217
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
Post #1090089
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse