|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 05, 2011 9:22 PM
Points: 9,
Visits: 32
|
|
Hi,
I am trying to create a package where I need to fetch server name information from one database (HQ) and then connect to all of those servers (Branch offices - BR) in a loop to copy certain data.
To do this, I am fetching the Server name information in an user object variable using an Execute SQL Task. Then, I am looping through all the entries in the object variable using a For Each loop and assigning server name to another string user variable (say sServerName). Inside this loop is the data flow task for copying data.
I am using expressions to set the 'ServerName' property of my connection manager from the sServerName variable. This works beautifully at design time and the value is reflected in connection information as i change the variable value.
However, during runtime, the variable value keeps on changing however the connection manager only uses the first value everytime instead of getting the new value from the variable. I have set DelayedValidation to true and RetainSameConnection to false.
Can you please help me with this? What do I need to do to get the value reflected in connection manager?
Thanks in advance for your help.
-Sid
|
|
|
|
|
SSC-Insane
         
Group: General Forum Members
Last Login: Today @ 12:02 AM
Points: 21,596,
Visits: 27,415
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 05, 2011 9:22 PM
Points: 9,
Visits: 32
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 11:25 PM
Points: 946,
Visits: 1,739
|
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, February 03, 2011 7:44 AM
Points: 151,
Visits: 341
|
|
siddharth.monani (8/13/2010) Hi,
I am trying to create a package where I need to fetch server name information from one database (HQ) and then connect to all of those servers (Branch offices - BR) in a loop to copy certain data.
To do this, I am fetching the Server name information in an user object variable using an Execute SQL Task. Then, I am looping through all the entries in the object variable using a For Each loop and assigning server name to another string user variable (say sServerName). Inside this loop is the data flow task for copying data.
I am using expressions to set the 'ServerName' property of my connection manager from the sServerName variable. This works beautifully at design time and the value is reflected in connection information as i change the variable value.
However, during runtime, the variable value keeps on changing however the connection manager only uses the first value everytime instead of getting the new value from the variable. I have set DelayedValidation to true and RetainSameConnection to false.
-Sid
I hope this dynamic mapping would not help inside data flow task. Because even if you map server name to the connection at run-time you can't do the column mapping dynamically between source & target in the data flow task.
You may need to try to achieve this in your control flow using execute sql task based on your need.
BASKAR BV http://geekswithblogs.net/baskibv/Default.aspx In life, as in football, you won’t go far unless you know where the goalposts are.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 05, 2011 9:22 PM
Points: 9,
Visits: 32
|
|
Baskar B.V (8/16/2010)
I hope this dynamic mapping would not help inside data flow task. Because even if you map server name to the connection at run-time you can't do the column mapping dynamically between source & target in the data flow task.
You may need to try to achieve this in your control flow using execute sql task based on your need.
Thanks Baskar.
The structure across all the databases on different servers will be the same, so that is not a concern.
-Sid
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 05, 2011 9:22 PM
Points: 9,
Visits: 32
|
|
Raunak Jhawar (8/16/2010) Siddharth,
Have you considered using SMO approach. This could be tedious as you will land up designing the entire component itself.
Not really because that's a long shot but thanks for suggesting. I might have a group of these packages to develop in near future and this is one good idea I could use for them.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 11:25 PM
Points: 946,
Visits: 1,739
|
|
Siddharth, Foreach with one scipt task and EST. Loop parameters ki value...name of server will change upon some condition....now we have a server name...script task and EST...easy...but remember to set DelayValidation to true....
Regards/Raunak Now a member of Linkedin
Please visit the all new Performance Point Forum Please visit the all new Data Mining and Business Analytics Forum
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, May 05, 2011 9:22 PM
Points: 9,
Visits: 32
|
|
Raunak Jhawar (8/16/2010) Siddharth, Foreach with one scipt task and EST. Loop parameters ki value...name of server will change upon some condition....now we have a server name...script task and EST...easy...but remember to set DelayValidation to true....
Thanks Raunak, this seems like a good idea. I'll try it out.
-Sid
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, March 01, 2011 10:08 PM
Points: 20,
Visits: 38
|
|
As Lyn suggested you can do this by changing the value in a script. Another way I have handled this (without using script) is to call a child package where it inherits the value of the server/connection string from the parent package.
I tend to this sort of Process Controller Package, and Child Process package quite a bit as it gives some structural separation between different packages and can give a lot of flexibility.
|
|
|
|