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

Need tip for updating query within foreach before feeding to data source

$
0
0

What is a good approach to modify a query variable on each iteration of a foreach loop?

Currently I have a dataflow task inside of a foreach.  immediately before the dataflow, I could use a script task to modify a variable that held a sql statement.

I would really rather use a stored procedure and just use a paramertized statement (using a ? placeholder) and set the data access mode to "sql command" instead of sql command from a variable.

However, barring the use of a stored proc, I think my approach is to simply replace the entire string value with a modified version, on each iteration.

Using a script task to modify a query before it gets to a dataflow task is ok when its only going to happen once, but what about within a loop?

Anyone got any tips for dealing with this situation?


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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