I am using SQL Server Management Studio 2012. I have a table with thousands of rows of data in it. Many of the rows are duplicates, and I need to remove them. Each row has a unique identifier [OwnerID] which is set to Identity Specification with an Identity Increment of 1. For each row, the duplicates lie in these columns: [FirstName], [LastName], and [CompanyName].
So I need to delete rows with duplicate combinations of values in these 3 columns. After the deletion, is there t-sql I can write to reset the Identity Specification in
[OwnerID] to start at 1 for the first row and assign values to the rest of the rows in increments of 1?
Thanks for any assistance.
Here is my try using the temporary tables SQL Fiddle: