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

What is a model database?

By

Do you ever take a look at SSMS in the System Databases section? People...

Daily Coping 26 Jan 2021

By

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

Rowcount estimates when there are no Statistics

By

When you don't have statistics, what does SQL use to calculate the estimated number...

Read the latest Blogs

Forums

[ODBC Error]

By DBA_007

When backup job runs we are receiving the below error and database connection closes....

Error: The size necessary to buffer the XML content exceeds the buffer quota

By Jim-S

Hi Guys, I have a report named Master and a report named Child, Child...

Issue in using Smartsheet CSharp SDK in SSIS Package

By rajeshlohar

Hi, I am using Smartsheet CSharp SDK in SSIS Script Task. I added it...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers