SSIS import data or insert data if no match

etlimportssis

I have a situation in which I need to import data from one table to another. The challenge here is in tables I have some columns which are references to other table values (kind of foreign key). I need to match these referencing columns and if fields match I need to map the respective id otherwise I need to insert that value in the referencing table and than map id in the source table data source and import all the data.

Elaborating my problem:

ETL with Lookups

So this is how my ETL look like. Currently I am "On Lookup Match" moving forward with execution but I also need to create new records in the respective table if "Look up don't match". (And this I need to do for all the 8 lookups I am doing). I do not understand how to do all this in sequence and import all the data at final stage.

Best Answer

Here is what i did:

  1. Created a new data flow to look up and insert non matching fields.
  2. Inserted the actual data flow.