Alex A
asked on
SSIS: Foreach Loop Container
Hi, there are many data files in the folder and I'd like to know the order they will be processed. I am using Foreach Loop Container. Does anyone know how it loops through the files, in alphabetical order or ... ?
The order of file loading is not predictable.
If you require an ordered loading, I'd use the first ForEach loop to get all file names and insert them into a table.
Then do a SQL Task to select that list, ordered by however you wish.
Then, go through a loop to set the source to that path-file, and load.
If you require an ordered loading, I'd use the first ForEach loop to get all file names and insert them into a table.
Then do a SQL Task to select that list, ordered by however you wish.
Then, go through a loop to set the source to that path-file, and load.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To be certain of your order you could read then in in a foreach loop, placing them into a table. Then read the table in the proper order into an Object Variable, and have a ForEach loop read the object variable and not directly from the disk.
hth
Mike