Showing posts with label Remove duplicates in SQL Server when tables have no primary key. Show all posts
Showing posts with label Remove duplicates in SQL Server when tables have no primary key. Show all posts

9 October 2013

Remove duplicates in SQL Server when tables have no primary key

Remove duplicates in SQL Server when tables have no primary key

I have table called CricketerDetails, and the table has no primary or unique key.
Below i have mentioned how to remove duplicate items with query.




















1. Procedure to remove the Duplicate rows with query is


Query

WITH tempTable as
(
SELECT ROW_NUMBER() Over(PARTITION BY FirstName,LastName,HighestScore ORDER BY FirstName) As RowNumber,* FROM CricketerDetails
)
DELETE FROM tempTable where RowNumber >1

SELECT * FROM CricketerDetails order by FirstName asc


Implementing OAuth validation in a Web API

 I mplementing OAuth validation in a Web API Implementing OAuth validation in a Web API using C# typically involves several key steps to sec...