Click here to Skip to main content
15,896,278 members
Articles / Database Development / SQL Server / SQL Server 2008

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

Rate me:
Please Sign up or sign in to vote.
4.95/5 (12 votes)
20 Feb 2011CPOL 107.4K   22  
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.
2 Sep 2011Ron sikander
Find out the number of duplicates in the table:select count(*), VISTX_ST_FIPS,VISTX_CTY_FIPS,VISTX_TC from TR00.NV_STARTER_INDEXgroup by VISTX_ST_FIPS,VISTX_CTY_FIPS,VISTX_TC having count(*)>1--- Delele them using following statementDELETEFROM TR00.NV_STARTER_INDEXWHERE...

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