Click here to Skip to main content
15,886,110 members
Articles / Database Development / SQL Server

How to remove duplicate rows in SQL Server 2005 when no key is present

Rate me:
Please Sign up or sign in to vote.
5.00/5 (6 votes)
20 Dec 2012CPOL 34.2K   16  
This tip describes how to delete duplicate rows from a table that doesn't have a key.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
22 Feb 2011Costica U
Here is another solution:IF OBJECT_ID( 'tempdb..#TestTable' ) IS NOT NULL BEGIN DROP TABLE #TestTable ENDCREATE TABLE #TestTable ( Column1 varchar(1), Column2 int )INSERT INTO #TestTable VALUES ('A', 1);INSERT INTO #TestTable VALUES ('A', 1); --...

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Europe Europe
Biography provided

Comments and Discussions