dbTalk Databases Forums  

Dynamic Database Connections in DTS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Dynamic Database Connections in DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Westmain
 
Posts: n/a

Default Dynamic Database Connections in DTS - 03-23-2006 , 12:45 PM






Hi,

I am using DTS to populate SQL Server databases from queries against an
Oracle database. I'm using what I'll call a 'master' script to truncate then
populate 74 SQL Server tables in 18 (as of now) different databases. These 18
databases all have the same tables, but will contain filtered data based on
some parameters. I'm using global variables to pass in values from another
package to the 'master' package. I am using in the queries in my 'master'
script to filter the data. All of this works fine.

The problem I'm having is that I need to call the 'master' package 18
times, each time writing to a different SQL database. The 'catalog' property
of my SQL Server connection object doesn't seem to be getting changed. I'm
passing in a global variable called 'gblSQLDB' and setting it's value to the
name of the SQL Database I wish to connect to. It is getting passed in
properly because I can display it in a MsgBox.

I have tried setting the property in an ActiveX script as follows:
oConnection.Catalog = DTSGlobalVariables("gblSQLDB").Value
and also tried using a Dynamic Properties Task and set the Destination
Property 'Catalog' to the global variable 'gblSQLDB'. Neither of these
methods work. The package, when called, will use the catalog that was set
when I last manually picked a Datbase in the Connection Properties dialog.
This of course causes my inserts to happen to the wrong database and results
in key violations, etc.

Any help with this matter would be greatly appreciated. The number of
databases I'm creating will eventually increase to over 300. Currently, I
have to change the Connection Database manually before I can run each
database.

--
Mike Silva
I.T. Specialist
Naval Undersea Warfare Center
Newport, RI

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.