Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic @@servername to assign to global variable 1

Status
Not open for further replies.

123FakeSt

IS-IT--Management
Aug 4, 2003
182
I found nothing but this unresolved thread after 20 minutes of searching for an answer:

thread961-806733

I would simply like the DTS package to know what server it is on, and be able to assign that to the dynamic properties of the SQL server connection.

I could make a table that is the same in both servers that has this info (is there a system table in the master database that lists server name?) but there must be a better solution. I could use an ActiveX VBS environment clue also, but there must be an easier way.


The early bird gets the worm, but the second mouse gets the cheese.
 
Hi,

1. Add a global variable to store the Server Name (Ex: strServerName)
2. Add a dynamic properties task to retrieve the Server from Environment Variable COMPUTERNAME into strServerName.
3. Add another dynamic properties task to override the DataSource Property of the connections with this global variable.
 
Thanks, not only did it work like a charm, but you used the actual global variable I was using in the package (strServerName)!



The early bird gets the worm, but the second mouse gets the cheese.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top