Eliminate Duplicates

This will find and delete all duplicate rows. You can refine the granularity of uniqueness by including more columns than just the Primary Key. If you are picky about which rows you want to delete, don't use this. Instead use the 'Find Duplicates' script I just submitted and then delete manually.

2002-05-24

1,080 reads

Find Duplicates

Find duplicates in any table, and report the number of duplicates. Enter in the table name, and the field or fieldsfor which there should only be one row for each of that field, but you suspect are more. For example, if an employee table has more than one record for an employeethis will find any […]

5 (1)

2002-05-24

569 reads

TableCounts

This script generates a statement that you would then run in the user database to get rowcounts of all tables. The advantages of this approach are you can modify it to get just the tables you want, and the output is easy to read:Table1-------1069Table2------10427

2002-05-24

405 reads

Blogs

Daily Coping 18 Sep 2020

By

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

Optimize for Unknown for Inline Table-Valued Functions

By

I had a curious performance issue today. An inline table-valued function (iTVF) was performing...

Daily Coping 17 Sep 2020

By

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

Read the latest Blogs

Forums

SQL 2017 MLS - cant add new python packages

By sqldude7777

Hi I'm new-ish to MLS and have been trying to add new python packages...

Find row closest to date

By boehnc

Just having trouble getting this to work as I hoped. Trying to extract entire...

SQL Query - FULL JOIN multiple tables but return NULL results

By glennyboy

Good day! Need help with my sql query code; first FULL JOIN "ILEtransfer" no...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers