dbTalk Databases Forums  

Passing Global Variables to Servers

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


Discuss Passing Global Variables to Servers in the microsoft.public.sqlserver.dts forum.



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

Default Passing Global Variables to Servers - 03-24-2006 , 08:55 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.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.