How to iterate over several files in several folders on SSIS?
I've got the following directory structure:
- Folder A
- sub-folder 1
- sub-folder 1.1
- file.xls
- sub-folder 1.1
- sub-folder 2
- sub-folder 2.1
- file.xls
- sub-folder 2.1
- ...
- sub-folder 1
I've used a foreach loop in SSIS in order to iterate over this directory structure and, for each Excel file named exactly file.xls I want to import data.
I created the for each loop exactly as in this article http://bi-polar23.blogspot.com/2007/08/loading-multiple-excel-files-with-ssis.html but when I run the package it stops when reaching the first file. Also, I've checked the "Traverse sub-folders" box.
Has anyone encountered this behaviour before? And if so, how can I solve this?
Thanks in advanc开发者_StackOverflow中文版e!
In SSIS you could use multiple Foreach Loop Container tasks.
It might be easier to create a batch file using robocopy and executing the .bat file using an Execute Process Task instead of multiple Foreach Loop Container tasks.
精彩评论