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
A hand holding a tulip bulb, paused above a spot where a shoot already grows in a garden bed.

Loading Only New Rows: INSERT SELECT With NOT EXISTS

December 25, 2019
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Constraint and Keys, SQL Scripts, SQL Server

Make loading only new rows repeatable with NOT EXISTS, EXCEPT, source deduplication, and a unique key that protects the destination.

Read More
A red hat reflected three times in a tailor's three-panel mirror, a hand reaching for the real one

Join Duplicates: Stop Hiding Extra Rows With SELECT DISTINCT

June 13, 2017
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Distinct, SQL Group By, SQL Joins, SQL Server

Diagnose join duplicates before using DISTINCT, verify order and payment totals, and choose aggregation or EXISTS for the required result.

Read More
A hand stacking four identical flat caps, crumpled, inside out, wet and flattened, on a lost-property shelf

Finding Near-Duplicate Rows With REGEXP_REPLACE

January 28, 2015
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Function, SQL Server, SQL String

Find near-duplicate rows with SQL Server 2025 normalization, group matching labels, rank survivors, and preserve originals for review.

Read More
Two pearl strands side by side on velvet, matched bead for bead, one pearl in the second strand a warmer shade.

Comparing Data Between Two Tables

January 29, 2014
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Joins, SQL NULL, SQL Scripts, SQL Server

Comparing data between two tables uses EXCEPT, full joins, and hashes, with explicit NULL and duplicate rules for trustworthy results.

Read More
Gouache painting of a tidy archive room with rows of plain wooden drawers, a brass key ring hanging on a hook and a magnifying glass resting on an open ledger with blank pages, one drawer handle painted vermilion.

Data Governance: Catalog, Lineage and Data Quality

January 14, 2014
Pinal Dave
SQL Tips and Tricks
Data Observability, Database, Duplicate Records, SQL NULL, SQL Server Security

Data Governance is how you know what data you have, where it came from, who can see it and whether it is right. This post covers the catalog, lineage, access and data quality, with T-SQL checks you can run.

Read More
Two nearly identical brown leather gloves on a hall table, both for the left hand, a hand hovering above them.

Finding Duplicate Customers With T-SQL

January 6, 2013
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Function, SQL Server, SQL String

Find duplicate customers with T-SQL by normalizing names, reviewing fuzzy matches, and merging records only after ownership is settled.

Read More
Two halves of a snap fastener join as one connection despite being presented from opposite sides

Unique Pairs in Either Order: Blocking A-B When B-A Exists

August 20, 2012
Pinal Dave
SQL Tips and Tricks
Computed Column, Duplicate Records, SQL Constraint and Keys, SQL Index

A plain unique index treats (1, 2) and (2, 1) as different rows. Two computed columns and one index fix that, and I test the awkward cases.

Read More
1 2 Next
  • Books
  • Testimonials
  • Privacy Policy

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