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
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
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
Two keys, one red and one brass, hanging on cords toward the single keyhole of a door lock.

MERGE Statement Quiz: What If Two Source Rows Match One Target?

January 20, 2012
Pinal Dave
SQL Puzzle
Output Clause, Ranking Functions, SQL Delete, SQL Table Operation

This MERGE Statement Quiz asks what happens when two source rows match one target row. The answer is error 8672, and the whole statement fails. A tested script shows the error, the fix with ROW_NUMBER and the same change written as UPDATE plus INSERT.

Read More
A pantry shelf where an old ceramic jar sits on a red tray beside the new jar that took its place.

OUTPUT Clause Quiz: What Do inserted and deleted Hold?

January 11, 2012
Pinal Dave
SQL Puzzle
Output Clause, SQL Delete, SQL Table Operation, SQL Transactions

This OUTPUT Clause Quiz raises a price from 10 to 12 and asks which two values come back. The answer is 10 and 12, because deleted holds the old row and inserted the new one. A tested script proves it and shows OUTPUT with INSERT, DELETE and an audit table.

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

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