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

Recovering Data from a Backup with SQL Data Compare

By

I had a customer recently ask about how to recover data from a backup...

Data Lakehouse defined

By

As a follow-up to my blog Data Lakehouse & Synapse, I wanted to talk...

SELECT * Hurts Performance, Badly

By

Quite a few years ago, I wrote a post about SELECT * and performance....

Read the latest Blogs

Forums

Unable to manage subscription.

By Syed_SQLDBA

I am working on troubleshooting an issue with the report server. I am able...

Opaque Encryption - with No Views, or Special SQL

By Vmusic

Hi, I want to encrypt certain columns in various tables in a SQL Server...

SQL Server Database availability

By crazdandconfusd

I'm looking for help in establishing an ODBC connection in Excel to an SQL...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Strange Code

See possible answers