SQLTeam.com | Weblogs | Forums

ForEach Loop File Type

Hi experts,
I'm building a package to import several Excel files on my SQL Server. The server does not have Excel installed but I have installed bot the of the ACE drivers.

In the ForEach Loop collection - I set the file to .xlsx but after I saev the package, it reverts back to .txt
The files in my input folder variable ARE .xlsx. I don't know what's going on but it's very frustrating, I'm stuck until I get over this hurdle.
Any tips?
Thanks

it could be a couple of things. In the Package configurations, do you have a config file setup? Are you using an expression to define the extension or a variable?

Thanks for the suggestion, mike01. Definitely no Config file. I have lots of variables yes.
I copied this package from another that does import txt files. So maybe if I rebuild the For Each from scratch? I have had this issue with other packages but I assumed it was related to Excel not being installed on the SQL Server. I DO have the ACE files installed though. I tried setting Fike to "Name and Extension", and Fully qualified and Name Only. With any of those, it reverts back to .txt after I save it

Check the expression(s) on the for each - the file pattern to be checked may be set/reset based on an expression or variable.

1 Like

Yes. Under the Collections tab, there was an expression containing .txt! After I changed it to .xlsx, everything is good. Thanks guys for the tips.