Search code examples
filessiscompareflat

How I will compare Two flat files in ssis?


TableOne.txt (txt file)

LoadNumber  Name    Address
101         Yogesh  ABC
102         Zebra   XYZ
103         Kattle  BTM

TableTwo.txt (txt file)

LoadNumber  Cost    EName
101         240     Yogesh
105         500     Kavita
110         340     Kamal

Now I want to compare these flat files. 1. I want to all data which is not present in table two text file base is LoadNumber and also I want all data which is not present in table one text files base is LoadNumber


Solution

  • 1- read both text files through a Flat File Source component

    2- Sort them by LoadNumber

    3- connect to a Merge Join compnonent (join type: full outer join) and join by TableOne.LoadNumber - TableTwo.LoadNumber

    4- Conditional Split based on ISNULL(tableXXXX.LoadNumber), e.g. if null for TableOne.LoadNumber then is missing from table1

    enter image description here