开发者

How to iterate over several files in several folders on SSIS?

开发者 https://www.devze.com 2023-03-31 07:22 出处:网络
I\'ve got the following directory structure: Folder A sub-folder 1 sub-folder 1.1 file.xls sub-folder 2 sub-folder 2.1

I've got the following directory structure:

  • Folder A
    • sub-folder 1
      • sub-folder 1.1
        • file.xls
    • sub-folder 2
      • sub-folder 2.1
        • file.xls
    • ...

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.

How to iterate over several files in several folders on SSIS?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消