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 puddle on the path, with a red scarf, a carrot and coal saved on the step

Table Variables Survive ROLLBACK: Logging Errors in a Transaction

September 28, 2013
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Transactions, SQL Variable

See how table variables survive rollback to retain error details, then write a permanent error log after a failed SQL Server transaction.

Read More
Berry picker gathering several berries beside one berry handled separately

Single-Row Inserts in a Loop: Why Commits Cost So Much

September 17, 2013
Pinal Dave
SQL Tips and Tricks
SQL Server, SQL Transactions, SQL Wait Stats

A loop that inserts one row at a time waits for the log on every row. Here is how to see it, and three ways to wait far less.

Read More
A hand picking a red lure from an open, neatly sorted tackle box

A T-SQL Cheat Sheet for Everyday Work

July 9, 2013
Pinal Dave
SQL Tips and Tricks
Cheatsheet, SQL Joins, SQL Server, SQL Transactions, Starting SQL

This T-SQL cheat sheet gathers daily SELECT, JOIN, GROUP BY, window, TRY_CONVERT, and transaction patterns with short examples.

Read More
Two bumblebees at one red poppy, one landed and the other veering away.

Snapshot Isolation Update Conflicts: Handling Error 3960

May 25, 2013
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Lock, SQL Server, SQL Transactions, Transaction Isolation

Reproduce snapshot isolation update conflict error 3960, compare read committed snapshot, and retry the whole transaction safely.

Read More
Several hands reaching into a crate of oranges, each taking a different one, one hand passing over a held orange.

UPDLOCK and READPAST for Queue Tables

April 22, 2013
Pinal Dave
SQL Tips and Tricks
Query Hint, SQL Lock, SQL Server, SQL Transactions

UPDLOCK and READPAST let SQL Server queue workers claim different rows safely when transactions, retries, and completion rules are designed.

Read More
A hand holding a bunch of grass stems by a campfire, one short stem with a red tip just drawn out

Picking Random Winners Fairly With NEWID and CRYPT_GEN_RANDOM

December 14, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Random, SQL Server, SQL Transactions

Pick random winners with NEWID or cryptographic randomness, handle weights and unique entrants, and save a draw with its seed and timestamp.

Read More
Gouache painting: a round wooden storehouse lined with a ring of grain bins, every bin empty and swept ready to refill except one whose small door is held shut by a vermilion latch

log_reuse_wait_desc: Why the Transaction Log Will Not Shrink

December 7, 2012
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Server DBCC, SQL Transactions, Transaction Log

log_reuse_wait_desc tells you why SQL Server cannot reuse its transaction log, so you know why a shrink gives nothing back. This post causes LOG_BACKUP and ACTIVE_TRANSACTION on purpose in a test database on SQL Server 2025, measures the log and fixes each one.

Read More
Previous 1 … 5 6 7 8 9 10 11 … 15 Next
  • Books
  • Testimonials
  • Privacy Policy

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