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?