SQLTeam.com | Weblogs | Forums

What are the items in a collection that referred in foreach item type enumerator within foreach loop container

Hello There,

When I recently gone through microsoft documentation about SSIS -- Foreach Item Enumerator, following points took my attention:

**> Foreach Item enumerator to enumerate items that are collections. For example, you can enumerate the names of executables and working directories that an Execute Process task uses.

You use the Foreach Item enumerator to enumerate items in a collection.**

From the above two highlighted statements, what are such items that considered to be collection? Is there any documented source to understand the concept of 'collection' and 'its items'?

Multiple files in a folder
Rows in a table
Etc

I have an example where I use it. For each store I collect the weather conditions. In a sql statement I collect the StoreID and the latitude and longlitude. I save the result as an object.

Then the Foreach Item Enumerator will collect for each store the current weather and the forecast based on the latitude and longlitude.

I'm pretty sure you can find great examples on youtube about this.

I don't use the for each file enumerator anymore - I use a script task to build a recordset object that is passed to the for each item enumerator. This allows me the control to sort the files and process them in the order I specify - which can be based on modified date, created date or timestamp in the file name (e.g. file_yyyymmdd.csv).