earwig75
asked on
Foreach Loop in SSIS not processing files correctly
I have a Foreach Loop Container and I'm using a variable to pick-up and process all xlsx files in a directory. It only works if I specify the full path and exact file name in the value of the variable.
I am using an excel connection manager in the package.
Is there a trick to making it pick up any xlsx files? I have the correct directory and filespec in the Foreach Loop properties, but again, it will only run the file I specifically point to in the Value of the expression.
Any help you can offer would be greatly appreciated, thank you.
I am using an excel connection manager in the package.
Is there a trick to making it pick up any xlsx files? I have the correct directory and filespec in the Foreach Loop properties, but again, it will only run the file I specifically point to in the Value of the expression.
Any help you can offer would be greatly appreciated, thank you.
Show us a screen shot of both the Control Flow, and the properties of the ForEach File Loop.
ASKER
Unfortunately, I can't.
ASKER
I should mention, it will pick up other files in that directory with different names, but at least one has to have the name that is specified in the variable.
Make your excel connection string by expression.
1. You have folder path in variable so you are iterating that folder.
2. Get each file name and take in variable.
3. Merge both variable to get full file path.
4. Use that value to excel connectionstring expression.
1. You have folder path in variable so you are iterating that folder.
2. Get each file name and take in variable.
3. Merge both variable to get full file path.
4. Use that value to excel connectionstring expression.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.