This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - Delete Duplicate Rows

SQL SERVER – Delete Duplicate Rows

June 23, 2009
Pinal Dave
SQL Video
Duplicate Records, SQL Function, SQL Scripts, SQL Server

Delete Duplicate Rows quickly with a CTE and ROW_NUMBER() in SQL Server 2005 and 2008. A sample table with 7 rows, 3 of them duplicates, shows how it works.

Read More
SQL SERVER - UDF - Remove Duplicate Chars From String

SQL SERVER – UDF – Remove Duplicate Chars From String

December 5, 2007
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Function, SQL Scripts, SQL String

A reader, Virendra Chauhan, shared a UDF that removes duplicate chars from one large string. Here is his REMOVE_DUPLICATE_INSTR function and how to call it.

Read More
SQL SERVER - Count Duplicate Records - Rows

SQL SERVER – Count Duplicate Records – Rows

July 11, 2007
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Scripts

A simple query to count duplicate records in a table using GROUP BY, HAVING COUNT(*) and ORDER BY, with the most repeated values first. A video is included.

Read More
SQL SERVER - Delete Duplicate Records - Rows

SQL SERVER – Delete Duplicate Records – Rows

March 1, 2007
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Scripts

A short query to delete duplicate records from a table with an identity column: keep the MAX(ID) in each group of duplicate columns and remove the rest.

Read More
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com