I would write a list to an SQL table and then a loop using a For Loop container wrapped around your container for each.
At the beginning of the For Loop container, I would read one entry from the list table using SELECT TOP 1, and pass it to the Recordset variable. The scope of this variable should be moved to the For Loop container.
At the end of the For Loop container, I would update the flag and / or datetime column to indicate that the row has been processed and should not be included in the next iteration of the original SELECT.
Along the way, you can update the list table to indicate the progress / status of each row.
This design is also useful for logging and restarting.
source
share