Home > Archive > MS SQL Server DTS > March 2006 > Passing Global Variables to Servers









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Passing Global Variables to Servers
Test Test

2006-03-24, 9:31 am

Hello!

I am having problem to pass global variables to sql servers. Please help
me.

I've 5 sql server connections in the DTS package. They are:

conn1
conn2
conn3
conn4
conn5

I added a Dynamic Properties task in this pkg and defined 3 global
variables to pass server names in these connections. They are
"gvServer1" (to conn1), "gvServer2" (to conn2, conn4) and "gvServer3"
(to conn3, conn5).

The value for "conn1" has been hard coded in the Dynamic Properties task
under "gvServer1".

The values (server names) for other 4 connections are coming from the
db. So, I added an Active script, wrote a code to get the server names
and assigned them to "gvServer2" and "gvServer3".

The steps/sequence of the package looks:

1. Dynamic Properties Task (To define global variables)
2. ActiveX script (To query the db and set the values for gvServer2
and gvServer4)
3. conn1 (Defined in the task)
4. conn2 (Coming from the db and storing it to gvServer2)
4. conn3 (Coming from the db and storing it to gvServer3)
5. conn4 (Coming from the db and storing it to gvServer2)
6. conn5 (Coming from the db and storing it to gvServer5)

(The workflow for all of them is set to upon completion).

The ActiveX script is working because I am getting the correct server
values for "strServer1" and "strServer2" and I am assigning them to
gvSource2 and gvSource3:

DTSGlobalVariables("gvServer2").Value= strServer2 'Get Source Server
2...st
DTSGlobalVariables("gvServer2").Value= strServer4 'Get Source Server 4

DTSGlobalVariables("gvServer3").Value= strServer3 'Get Source Server 3
DTSGlobalVariables("gvServer3").Value= strServer5 'Get Source Server 5

//strServer2, strServer3, strServer4, strServer5 are local variables
inside the ActiveX script

But these values are not passing correctly in all connections. I need
gvServer2 to pass conn2 and conn4, but when the pacakge runs, it only
updates conn4. The same is for gvServer3, the value get passed only in
conn3 and it does not not pass in con5. What I am missing here. Am I
doing it correctly? Do I need to create 5 global variables for each
connection?

Thanks for your help!






*** Sent via Developersdex http://www.droptable.com ***
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com