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
An empty extended bicycle repair stand takes more floor space than an identical folded stand

Deleting From a Heap: Why Empty Pages Stay Behind

May 27, 2015
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Delete, SQL Heap

The rows are gone but the table is the same size and scans are just as slow. Here is why, and two ways to fix it.

Read More
Hands digging through a huge bin of mixed balls for the red ones, an empty sorted rack standing unused

Foreign Keys Without Indexes: Finding and Fixing Slow Deletes

July 9, 2014
Pinal Dave
SQL Performance
SQL Constraint and Keys, SQL Delete, SQL Index, SQL Performance

Find foreign keys without indexes, inspect parent-delete plans, and choose leading child-table keys that support relationship checks.

Read More
A hand lowering a record player's needle just before a scratch on a spinning record with a red center

Point-in-Time Restore: Getting Back Rows Deleted by Accident

June 9, 2014
Pinal Dave
SQL Tips and Tricks
DBA, SQL Backup and Restore, SQL Delete, Transaction Log

Plan a point-in-time restore after an accidental DELETE, preserve the log chain, recover a separate copy, and return reviewed rows.

Read More
A pinsetter deck holds round bowling pins while a square block cannot fit its opening

Edge Constraints: Controlling Which Nodes a Graph Edge Connects

November 19, 2013
Pinal Dave
SQL Tips and Tricks
Schema, SQL Constraint and Keys, SQL Delete

An edge table with no rules accepts nonsense links. Add an edge constraint, watch the bad edge fail, and see what the constraint still does not check.

Read More
A row of wall switches on wooden plates, the middle switch red and the others muted gray and cream.

Commenting Out Code: Testing Safely in SSMS

August 25, 2013
Pinal Dave
SQL Tips and Tricks
SQL Delete, SQL Scripts, SQL Server Management Studio, SQL Shortcut

Commenting Out Code is the quickest way to switch off part of a script while you test the rest. This post covers the SSMS shortcuts, testing one WHERE filter at a time, the trap of GO inside a block comment, and a safety note to leave above a DELETE.

Read More
Gouache painting of a wooden pantry shelf with a row of identical cream jars, three of them crowded together and only one wearing a vermilion lid.

Delete Duplicate Records in SQL Server: SQL in Sixty Seconds #036

December 19, 2012
Pinal Dave
SQL Video
Duplicate Records, SQL Delete, SQL in Sixty Seconds, SQL Index

To delete duplicate records safely, look at them first. The tests here find the duplicates, preview the rows that will go, delete all but the newest copy inside one transaction and add a unique index so they cannot return. Every query ran on SQL Server 2025.

Read More
A hand lifts the top glass from a pyramid of stacked glasses, a red napkin at its base.

Walking Foreign Key Chains to Find a Safe Delete Order

November 3, 2012
Pinal Dave
SQL Tips and Tricks
CTE, SQL Constraint and Keys, SQL Delete, SQL Server

Map foreign key chains from a parent table with a recursive catalog query, then list deepest children first and flag cascade rules.

Read More
Previous 1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

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