Hi SSIS community!
Recently I came across a business requirement where I have to process multiple flat files. Please note that these files have different attributes. In short, the scenario look like this:
1. I have a directory e.g. Ins_Upd_Del
2. I have following files in that directory:
Employee_Insert.csv
Employee_Update.csv
Employee_Delete.csv
Order_Insert.csv
Order_Update.csv
Order_Delete.csv
Product_Insert.csv
Product_Update.csv
Product_Delete.csv
:
:
There are 21 files like these. The files that are related to one entity, has the same structure. Employee_Insert, Employee_Update, Employee_Delete has the same format. Same format = No of columns and column defination is same.
All Order related files has the same format. ( Which is different than Employee) etc..
3. I can create a SSIS package for each of these files and will generate an action accordingly. E.g One package for Employee_Insert which will insert records to Employee table. Anotehr one for Employee_Update which will update the employee table.. etc..
4. I'm trying to find a way by which I can do the desired tasks in One Package? Is this possible? I'm using SQL Server 2008 R2
Here are some of the ways that I'm thinking about: ( Not yet sure, whetehr it is possible or not)
Looping over the files in the directory and depending upon the name of the file, it will dynamically configure the Flat file connection and so the OLEDB destination.
Or A Top level package , that will loop through the different packages to call them depending upon the file name
Or ..?
I'll appreciate, if you could suggest me the best method (not limited to what I'm thinking above ) and some tips on how to acheive that..
Thanks you !