Merge Transformation

Definition:- Merge Transformation is an SSIS component that can combine two sorted inputs into a single outputs.

  • For example we have one data source in a CSV file and another data source in SQL server table, then using the Merge Transformation we can merge both data sources into a single output data source.

Procedure:-

  • Login to SSIS go to Solution Explorer right click on SSIS package click on new SSIS package and rename it.
  • Drag the data flow task in control flow.
  • Double Click on the dataflow task.

  • Drag the FLAT FILE Source then double Click on it.
  • Go to connection manager and give new connection then check the Column and preview and click on ok.
  • Drag the OLE DB Source  then double  Click on it
  • Go to connection manager and give connection and select the name of SQL table .
  • Check the column and click ok.
  • Drag the 2 SORT TRANSFORMATIONS and connect the flat file source and OLEDB  SOURCE then double  Click on it
  • Double click on sort transformation.

  • Here we give the required input column and give the sort type (Ascending/Decending)and click on ok .
  • Double click on sort 1 transformation

  • Here also we give the required input column and give the sort type (Ascending/Decending)and click on ok.
  • Drag the Merge Transformation and connect it to the both sort transformations

  • Drag the OLE DB Destination connect it to the merge transformation to OLE DB Destination give the new name of the table check the mapping click on ok

Click on  execute:-

SSIS Package:-

Source Table:-

Output:-