title: Data move to historical table whenever new data with same key appear during 2nd load In SSIS
body: <p>i am struggling how i can design this. appreciate your suggestion.</p>
  
  <p><strong>We are loading data using SSIS ETL Package.</strong></p>
  
  <p>I have 2 tables Active and History.</p>
  
  <p>When we load the active table historical table will remain empty. 
  when we will load data have same (comp_id+SKU+COMP_SKU) the older data need to move to historical table old data move to history table.</p>
  
  <p><strong>my idea is to used Trigger.would like to know your valuable suggestion.</strong></p>
  
  <pre><code>USE tempdb;
  CREATE TABLE ACTIVE
  
  (
  COMP_ID INT ,
  SKU INT,
  COMP_SKU VARCHAR (100),
  PRICE_INCVAT FLOAT,
  [ValidFrom]     DATETIME DEFAULT GETDATE(),
  [TODT]       DATETIME DEFAULT ('12/31/9999') 
  
  )
  
  SELECT * FROM ACTIVE
  
  INSERT INTO ACTIVE (COMP_ID,SKU,COMP_SKU,PRICE_INCVAT,VALIDITY_DATE)
  VALUES ('1001', '101110048',    '642BM0045',    '47.45',    '12/26/2016  5:04:00 AM')
  
  INSERT INTO ACTIVE (COMP_ID,SKU,COMP_SKU,PRICE_INCVAT,VALIDITY_DATE)
  VALUES ('1001', '101110046',    '642BM0040',    '35.14',    '12/26/2016  5:04:00 AM')
  When we will do 2nd load like given below
  
  /*
  2nd load data
  
  1001    101110046   642BM0040   65.52   6/26/2016 5:04  31/12/9999
  1001    101110048   642BM0045   47.45   6/26/2016 8:04  31/12/9999
  */
  
  after 2nd load history table will look like given below
  
  /*
  HISTORY TABLE
  
  COMP_ID PNO COMP_PNO1   PRICE_INCVAT    Validity_date   TODT
  1001    101110046   642BM0040   35.14   12/26/2016 5:04 **6/26/2016 5:04**
  1001    101110048   642BM0045   47.45   12/26/2016 5:04 **6/26/2016 8:04**
  
  */
  </code></pre>
  
  <p>Please help me to design this.</p>