SSIS package to read and import date from TXT files into SQL table

Hello Experts, I'm writing a SSIS package in SQL2008R2 to read and import flat files into SQL tables. I have done this in the past with XML files, where you are able to set the name of the XML file as a variable, however the flat file task does not have this option. How do I set the file name and get the connection source to the file to be a variable from the for each loop container?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi, yes it is possible, probably similar to your XML file process.

Here is the part in a MS tutorial, that will help you.
EddieITAuthor Commented:
I got that far, on the for each loop container variable settings are clear, however when I add a file task to the data flow of the container, I'm not able to specify the file name as source as a variable

Not seeing exactly what you have...But I think the problem is here....

If you look at your flat file connection manager.

Look at the Properties, and the Expressions,
The Connection string connection has to be the variable you have set for the filename.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.