Remove Duplicates from Table - No Cursors

This script deletes all duplicates from a table.  It keeps the first instance of the record, and discards all others.  If you want to keep the last instance of the record, use MAX instead of MIN.  The script can be modified very easily to include more/less fields for comparison.  I've successfully used this SP to […]

2004-07-27 (first published: )

264 reads

Blogs

Daily Coping 26 Nov 2020

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Azure SQL Database – Greatest and Least TSQL

By

Being in the cloud does have many benefits, from lower administration to fast scaling...

T-SQL Tuesday Retrospective #005: Reporting

By

A few weeks ago, I began answering every single T-SQL Tuesday from the beginning....

Read the latest Blogs

Forums

How to know which index is invalid index on a table?

By 892717952

There are about thirty fields in a table SaleOrderLines, I created some indexes ,...

Thanksgiving 2020

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Thanksgiving 2020

Thanksgiving Visualizations

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Thanksgiving Visualizations

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers