SQLTeam.com | Weblogs | Forums

Foreach File Enumerator loop only returning one file


#1

Hi,
I have a package that is using a Foreach File Enumerator loop to go through a folder and pull in the data from a 3 Excel files; and insert the data inot a table in SQL Server. However, it goes through the first file, three times and inserts the row of that file 3 times in the table. But the it never goes through the other files.
I realize this may be dificult to answer without seeing it.
Does any one know what I ma be doing wrong or what I can look at.

Thank you


#2

From your explanation it sounds like something is correctly identifying that there are three files but is not adjusting the filename on each loop iteration - so in effect it is correctly opening / importing three files, but its the same file each time.

That's what I would investigate first.


#3

Thank you that sounds right. The problem I have is that everywhere I search for how to do this, it is a little different. so I am not sure what to look for. You say it is the file name do you have an idea as to what should I look for that would hold the file name.
Thank you


#4

I know ZERO about SSIS, but can you put a DEBUG / PRINT statement in that Loop so that you can "see" what the filename, of the file enumerator, is on each iteration fo the loop?


#5

Thanks I solved it.
Ed