By some setting as using IDENTITY_INSERT we have duplicate entry in identity column, What is the best method of removing duplicate entry.
I have a table Details With column DetailID | FKey | Col1 | Col2 | Col3 | Col4
DetailID is "Identity" and FKey is foreign key with another table.
Now we have already 240000 record. Some one used "IDENTITY_INSERT" which was not for this table but by mistake it applied to it. So it hase record with duplicate identity.
So first we need to pick only those row which have same identity after that we need to match data of all column if all are same then keep only one row and remove others but is only identity is duplicate then we need to update identity value.