I am using LINQ along with Entity-Framework to insert some data in a SQL Server 2012 Database.
My Database Table in which the data is being inserted has a primary key and i am inserting about 1000 Records at once.
That is i retrieve data in a set of 1000 rows and save those 1000 rows at one time for performance reasons.
Now the problem is i may occasionally get a duplicate value for any of the row in those 1000 rows and when that happens none of the rows are saved in the database.
Is there any way i can just silently ignore that one row and not insert it while all the other non duplicate rows get inserted?
Also i did try querying the database before every insert but the performance cost for that is too high.