I am working on a pipeline where I am using Excel as the source. The data has a primary key let's say Id
, which is repeating multiple times in the Excel.
Now, when I insert it into a SQL database, it fails with the error:
java.sql.BatchUpdateException: Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object 'dbo.xyz'. The duplicate key value is XXXX.
How can I make take care of this scenario using mapping data flows in ADF?
I am using a mapping data flow here to take care of the different other transformations.
Example of such data, coming from the Excel source
ID Name PhoneNo
1 John Doe 11110000
1 John Doe 88881111
2 Harry Potter 88999000
2 Harry Potter 00001112
3 abc xyz 77771111
I need to take save the top 1 ID and Name (and there are more columns) in one table and Phone No and ID will be saved in another