Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data Source Project Object


Data Source Project Object

Author
Message
matt.mallen
matt.mallen
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

Group: General Forum Members
Points: 118 Visits: 224
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
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9886 Visits: 19808
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.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
matt.mallen
matt.mallen
SSC-Enthusiastic
SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)SSC-Enthusiastic (118 reputation)

Group: General Forum Members
Points: 118 Visits: 224
Thanks so much. Worked like a charm.
DLathrop
DLathrop
SSC-Enthusiastic
SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)SSC-Enthusiastic (102 reputation)

Group: General Forum Members
Points: 102 Visits: 219
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search