I need help creating an SSIS package in SQL Server 2008R2

Hi Experts,
I need to create and SSIS package in SQL Server 2008 R2for an EDI project .  The package needs to import data from one or more .csv file(s) into a table in a SQL Server 2008 R2 database.
The files are need to be retrieved from the following path:  \\EDIFiles\SFTP\TARGET .
The .csv files have 20 columns, but only 5 on those columns need to be imported into the SalesOrder table.
Once each file is processed, it needs to be archived in the following folder:  \\EDIFiles\SFTP\TARGET\Archive.

How do I do this?  Thank you very much in advance,
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Barry CunneyCommented:
Hi MRotor
In SSIS 'Control Flow' tab you can add a 'Foreach Loop Container' - set the Eumerator to 'Foreach File Enumerator'
and in the Enumerator Configuration set the 'Folder' to \\EDIFiles\SFTP\TARGET(Note: if this is a remote file share it may be best to to move these locally first - 'File System Task' can be used for this) and set the 'Files' to *.csv
Create and Map a variable in this Loop Container that will receive the filename on each iteration

Insert a 'Data Flow Task' into the center of the above Foreach Loop Container
Create a flat file connection manager which gets its Connection String value from the variable mapped in the For Each Loop above  - set this flat file connection as the Source to Data Flow Task and set the SQL Server table as the Destination

For the archiving use a FileSystem Task to move the files - this can also be placed in the ForEach Loop and a precedence constraint joining it from the Data Flow task so that files only get archived after they have been imported.

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
mainrotorAuthor Commented:
Thanks Barry,
I have gotten everything to work except for the archiving portion.  I will try tomorrow and let you know if it worked.

Once I finish this SSIS package, how do I deploy it and get it ready to use within a SQL Server Job?  Thanks once again in advance.

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 2008

From novice to tech pro — start learning today.