Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Business Requirement. I have lots of text files in a folder location. Say for an example:
**Sales_Newyork_1102_2012.txt**
**Sales_Texas_1102_2012.txt**
**Sales_Dallas_1102_2012.txt**.

I need to insert all these files to tables similar to the file structure. Sales_Newyork_1102_2012 file to Sales_Newyork table and Sales_Texas file to Sales_Texas table and Sales_Dallas_1102_2012 file to Sales_Dallas table.

The catch is that all these table structures differ one to another.

How can i do this using SSIS? I guess using a for each loop with some data flow task would be a start.

Can some body give me a step by step example on how i can achieve this.

Thanks in advance
Posted
Updated 21-Nov-15 8:39am
v2

1 solution

There are some articles out there you can read

Here is one SSIS - Import Text File[^]

Here is another one: Loop through Flat Files in SQL Server Integration Services[^]

On a side note. Depending on how large the data you have is, it might be better to consider to use one table and add a column with the name of the state.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900