I am working in SQL Server 2008 and SSIS (BIDS). I have 1 flat file that I want to import into several tables by keying off one of the columns. The number of columns varies for each key.
For example, suppose I have a flat file with 2 different record types in it -- record type A and record type B. All records of "record type A" have 5 columns. All records of record type B have 10 columns. Column 1 holds the record type flag (e.g., 'A' or 'B') for all records. So, upon import of this 1 flat file, I want all 'A' records to go into my 'A' table, and I want all 'B' records to go into my 'B' table.
How do I achieve this in SSIS? If the 1 flat file was split up into 2 separate flat files, then I could set up a data flow task for each file. I have read that it might be best to import all records into a single staging table and then write a SELECT statement to do the subsequent imports into tables A and B. I'm not certain, though, if this is best practice.