In my target table, where I want to insert the records from my text file, the record with primary key EDF010 already exists.
In my text file I have the following rows:
EDF800,New Pradera,Zepita 123,L-01,450,430,Perímetro de Lima,EST001
EDF900,New Oh Sol,Malecón Checa 357,L-14,178,158,Perímetro de Lima,EST001
EDF010,New Nogal,Josè Pizarro,L-21,246,226,Perímetro de Lima,EST001
Is there a way to validate the duplicate records so that only the duplicates are not inserted and the error is not thrown?
Msg 2627, Level 14, State 1, Line 15
Violation of PRIMARY KEY constraint 'PK__EDIFICIO__CE4324755BE55BAA'. Cannot insert duplicate key in
object 'Renta.EDIFICIOS'. The duplicate key value is (EDF010).
The statement has been terminated.