Using query results as an enumerator for a ForEach Loop
Is there way to provide a query as the enumerator for a ForEach Loop? Or do I need to execute the query in a Script Task and store the results in an array or DataTable?Paulo Morgado
November 29th, 2010 7:08pm

Create a variable of type "Object" Use the Execute SQL task to run the query - set the resultset property to "Full Result Set" and go to teh Result Set window in the gui. Set Result Name = 0 and Variable Name to your object variable Create a For Each Loop and set the collection type to Foreach ADO Enumerator and ADO Object Source Variable to your object variableRgds Geoff
Free Windows Admin Tool Kit Click here and download it now
November 29th, 2010 8:24pm

Thanks. I had been fooled by the ADO Object Source Variable instead of ADO.NET Object Source Variable.Paulo Morgado
December 8th, 2010 8:26pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics