dbTalk Databases Forums  

changing DSN connections dynamically

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


Discuss changing DSN connections dynamically in the microsoft.public.sqlserver.dts forum.



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

Default changing DSN connections dynamically - 11-14-2005 , 07:30 PM






Hi,

Is it possible to change the connections of a DSN dynamically via DTS?
I need to pump data to approx 100 different destination servers and am
hoping that it is possible to do this by simply changing the Server
name/IP of a DSN.

Any help is greatly appreciated.


Reply With Quote
  #2  
Old   
Ben Nevarez
 
Posts: n/a

Default Re: changing DSN connections dynamically - 11-14-2005 , 10:30 PM







I remember doing something similar using Dynamic Properties. From the Help
'You can change package properties at runtime with values from an .ini file,
query result set, global variable, environment variable, data file or
constant'.

Ben Nevarez



"enzat" <enzat (AT) spotlight (DOT) com.au> wrote

Quote:
Hi,

Is it possible to change the connections of a DSN dynamically via DTS?
I need to pump data to approx 100 different destination servers and am
hoping that it is possible to do this by simply changing the Server
name/IP of a DSN.

Any help is greatly appreciated.




Reply With Quote
  #3  
Old   
enzat
 
Posts: n/a

Default Re: changing DSN connections dynamically - 11-14-2005 , 11:02 PM



Hi Ben,

I've tried something similar myself, but haven't been successful.
Are you able to offer more detail?

Thanks


Reply With Quote
  #4  
Old   
Test Test
 
Posts: n/a

Default Re: changing DSN connections dynamically - 11-15-2005 , 02:32 PM



Enzat,

Try this. In your DTS package (lets call it MyDTS.dts):

1. Create a Dynamic Properties Task
2. Create two global variables. One is for Server (lets call it
gvServer) and one is for DB (call it gvDB)
3. Create a job and use "dtsrun" to execute the package. Use /A for your
global variables. Open T-SQL window and write this script:

declare @dts varchar(100)
set @dts = 'dtsrun /Fc:\MyDTS.dts /NMyDTS /AgvServer:8=' + @@servername
+ ' /AgvDB:8='+ @@DB_name

exec master.dbo.xp_cmdshell @dts

Hope this helps!


*** Sent via Developersdex http://www.developersdex.com ***

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.