all groups > sql server dts > november 2003 >
You're in the

sql server dts

group:

DTS database flexibility


DTS database flexibility David Morrison
11/6/2003 1:50:39 PM
sql server dts:
I have a DTS package that copies data from tables in one database to the
same tables in another database, deleting records in the destination tables
first. How can I easily change the source and destination database
references throughout the DTS package so I can reuse the DTS package
elsewhere? All the tables will be the same.

Re: DTS database flexibility David Morrison
11/6/2003 2:48:15 PM
I don't really see anything there that addresses this question. I'm working
with SQL Server databases, not Access. There are a bunch of references to
code but I'm not a programmer. I'm looking for a place in SQL Server
Enterprise Manager where I can alter the DTS package so that it will look to
different databases.

[quoted text, click to view]

Re: DTS database flexibility Allan Mitchell
11/6/2003 9:43:18 PM
Have a look at this

Connections
(http://www.sqldts.com/default.aspx?101)

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]

DTS database flexibility RLoski
11/7/2003 4:03:48 AM
You add global variables to the project for the server
name and the database name. Then you add a Dynamic
Properties task (look for Dynamic Properties Task in the
bol index). You find where the server name is used and
set the property from the global variable.

Russ Loski, MCSD
Re: DTS database flexibility David Morrison
11/7/2003 6:54:50 AM
That sounds good. I'll look into it. Thanks!

[quoted text, click to view]

Re: DTS database flexibility David Morrison
11/7/2003 9:55:25 AM
Russ,

I see how this works and it's great! One question I have though is how do I
insert a global variable when the property is a SQL Statement? The global
variables worked well for setting the server name property which was a
value, but now I have a property that's a query like "delete from
[DestinationDatabase].[dbo].[PM00100]". How can I embed a global variable
into the query for DestinationDatabase?

I'm using constants for my global variables.


[quoted text, click to view]

Re: DTS database flexibility Tim Harris
11/7/2003 3:58:44 PM
Can you leave out "[DestinationDatabase].[dbo]" from your SQL statement?


[quoted text, click to view]

Re: DTS database flexibility David Morrison
11/7/2003 6:11:18 PM
You're right. I don't. Now it works. Thanks!

[quoted text, click to view]

Re: DTS database flexibility Allan Mitchell
11/9/2003 5:57:47 AM
OK. The concept is the same it just doesn't have Your exact circumstances.
If you are using SQL Server 2000 you have an array of options but the
Dynamic Properties task is as good a task as any. You assign a value from an
external source to the DataSource AND/OR Catalog properties of your SQL
Server connection. That external source ranges from an INI file to a
database query.

Have a look.



--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

AddThis Social Bookmark Button