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
Gouache painting of a hedge maze with a long winding path and a quick exit through a vermilion arch

RETURN Statement in a Stored Procedure: Exit Early

November 2, 2019
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Stored Procedure, SQL Transactions

The RETURN statement ends a stored procedure at once and hands back one integer status code. This post builds a small demo, shows how to read the code, stops a procedure after a chosen step, and tests what RETURN does with NULL, text, open transactions and errors.

Read More
A bike rack with one long red chain looped through every slot while a cyclist waits with nowhere to park

Counting Locks per Session With sys.dm_tran_locks

September 13, 2019
Pinal Dave
SQL Performance
SQL DMV, SQL Lock, SQL Server, SQL Transactions

Count locks per session by resource and mode, connect open transactions, and recognize escalation while keeping snapshot limits clear.

Read More
Gouache painting of a row of fruit baskets, three covered and clasped and one open vermilion basket of peaches

READPAST Query Hint: Skip Locked Rows in SQL Server

August 31, 2019
Pinal Dave
SQL Tips and Tricks
Query Hint, SQL Lock, SQL Scripts, SQL Transactions

The READPAST query hint makes a read skip rows that another transaction has locked, instead of waiting for them. This post builds a five-seat demo, runs it in two windows and lists the cases where the hint does nothing. It also shows the work queue pattern that pairs READPAST with UPDLOCK.

Read More
Gouache painting of an open wooden music box on a piano stool with a jammed vermilion cylinder inside

Error 41368: Memory-Optimized Tables and Transactions

June 11, 2019
Pinal Dave
SQL Tips and Tricks
In-Memory OLTP, SQL Error Messages, SQL Scripts, SQL Transactions, Transaction Isolation

Error 41368 appears when an explicit transaction reads a memory-optimized table at the read committed level. This post reproduces the error, fixes it with a table hint or a database option, and shows the two related errors that the fixes do not cure. It also answers what the option changes for other tables.

Read More
Illustrated cover: Instant Rollback

SQL SERVER – Getting Started with Accelerated Database Recovery – Instant Rollback

May 13, 2019
Pinal Dave
SQL Performance
SQL Scripts, SQL Server, SQL Server 2019, SQL Transactions, Transaction Log

Killing a long transaction used to mean a rollback that took forever. SQL Server 2019 fixes that with Accelerated Database Recovery and its instant rollback.

Read More
A doorstop holding an unattended heavy door and preventing a rug from passing

Finding Long Open Transactions With sys.dm_tran_database_transactions

April 26, 2019
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Transactions, System Database

A forgotten BEGIN TRAN can pin your log for hours. Here is how to find the owner, read its age, and confirm the transaction is the reason.

Read More
Title card: DBCC CHECKDB Waiting on PREEMPTIVE_OS_DEVICEIOCONTROL

SQL SERVER – DBCC CHECKDB Waiting for PREEMPTIVE_OS_DEVICEIOCONTROL

October 22, 2018
Pinal Dave
SQL Performance
SQL Error Messages, SQL Server, SQL Server DBCC, SQL Transactions, SQL Wait Stats

A weekly DBCC CHECKDB job was stopped by a terminator job, but its SPID stayed, waiting on PREEMPTIVE_OS_DEVICEIOCONTROL. Here are ways to handle that situation.

Read More
Previous 1 2 3 4 5 6 7 … 15 Next
  • Books
  • Testimonials
  • Privacy Policy

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