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
Chestnut scoring knife making an opening beside scored and untouched chestnuts

OPENJSON WITH Clause: Converting JSON Properties to Typed Values

March 14, 2016
Pinal Dave
SQL Tips and Tricks
JSON, Output Clause, SQL Union clause

Without WITH, OPENJSON hands you text. With it, you pick the names and types and decide what happens when a property is missing.

Read More
A chalk line reel beside a persistent blue mark and cord ready for another snap

The Outbox Table: Publishing Changes Reliably From a Transaction

March 4, 2014
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Lock, SQL Transactions

Orders commit and the message vanishes? Save both in one transaction, then let a worker claim, send and retry with a lease. Duplicates are still possible.

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
A hand holds one cloth napkin free of a metal holder while the remaining stack stays inside

Destructive Reads: Pulling Work From a Queue Table With OUTPUT

June 10, 2011
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Delete, SQL Transactions, Temp Table

Claiming a job and finishing it are two different things. Try a delete claim, a rollback, and an update claim on a tiny queue.

Read More
The parts of a taken-apart carburetor laid out in neat rows on a cloth on a workbench, a hand placing the last piece

Shredding sp_server_diagnostics Output Into Health Rows

September 30, 2010
Pinal Dave
SQL Tips and Tricks
Comprehensive Database Performance Health Check, Output Clause, SQL Server

Check shredding sp_server_diagnostics with SQL Server examples, practical queries, clear limits, and steps to verify your own database.

Read More
Hands splicing two ropes together, one strand slipping loose

MERGE Statement Pitfalls

January 10, 2010
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Server, SQL Transactions, SQL Trigger

MERGE statement pitfalls include duplicate source keys, concurrency races, trigger surprises, and complex actions that deserve testing.

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

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