Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

issue with OLEDB connection with "RetainSameConnection" inside foreach loop

$
0
0

So here is my problem.

<for each loop through the remote server names>

     step1:  <Execute complex sql code in that remote server and store the result in global temporary table>(Execute SQL Task)
     step2: <Inside the Data flow task : Source-Remote Server, Destination-Local Dynamic files based on the server name>(Data Flow Task)
<end of For each loop>
In step 1 and Step 2, the connections to remote server are updated based on the server names and I am using "RetainSameConnection" property for that connection.
But it seems like the process works perfectly fine for first iteration but as it retained the previous connection it can't create new connection to new server in second iteration and I am getting same results for each iterations.

So Here is what I am trying to do

<for each loop through the remote server names>

     step1: Force the retainsameconnection to true using script task

     step2:  <Execute complex sql code in that remote server and store the result in global temporary table>(Execute SQL Task)
     step3: <Inside the Data flow task : Source-Remote Server, Destination-Local Dynamic files based on the server name>(Data Flow Task)

     step 4: Force the retainsameconnection to false using script task
<end of For each loop>

So I need the code for step 1 and step 2. Can anyone please help me?

I am also looking for other design options.

PS: I have only read access to remote server.





 


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>