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 seedling in a small pot beside a tall grown tree with a vermilion watering can between them

Implicit Transactions in SQL Server: The Setting That Leaves Work Open

May 23, 2023
Pinal Dave
SQL Tips and Tricks
SQL Connection, SQL DMV, SQL Lock, SQL Transactions

Implicit transactions make SQL Server open a transaction on the first data statement and keep it open until a COMMIT or ROLLBACK. This post shows what starts one, how @@TRANCOUNT counts it, why a second session waits, and how to find and clear the sessions that left work open.

Read More
Gouache painting of a snail with a vermilion shell crawling along a long boardwalk

Long Running Queries in MySQL: Find Them in Two Ways

June 16, 2022
Pinal Dave
SQL Performance
Idera, MySQL, SQL Lock

Find long running queries in MySQL with two built-in methods: the slow query log and the Performance Schema digest table. See the settings, a ready query and how to choose between them.

Read More
Gouache painting: a wooden loom holding a half-woven linen runner in cream and sage, the last stretch unpicked into loose threads on the floor, with one vermilion knot marking where the finished cloth ends

SAVE TRANSACTION: Roll Back Half a Transaction

September 15, 2021
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Lock, SQL Stored Procedure, SQL Transactions

SAVE TRANSACTION sets a marker inside an open transaction. You can roll back to it and keep the earlier work. This post tests it on SQL Server 2025. It shows why a nested BEGIN TRAN can’t do the same and what XACT_STATE() returns after an error.

Read More
An inspection bridge observes a workpiece while separate holding mechanisms remain visible.

SQL SERVER – NOLOCK with DMVs

September 14, 2021
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Lock, SQL Scripts, SQL Server

NOLOCK with DMVs is not a blanket reassurance against monitoring waits. A customer asked about omitting the hint.

Read More
A heavy sled hauled almost to the top of a snowy slope, its red rope trailing back down

Before You KILL a Session: Estimating the Rollback Cost

February 4, 2021
Pinal Dave
SQL Tips and Tricks
DBA, SQL Lock, SQL Server, SQL Transactions

Before you KILL a session, inspect its transaction age, log bytes, current command, and likely rollback work, then monitor the undo safely.

Read More
Birds spaced along a power line except around one red insulator where dozens crowd together

Finding the Indexes Behind Lock Waits With Operational Stats

January 18, 2021
Pinal Dave
SQL Performance
SQL DMV, SQL Index, SQL Lock, SQL Wait Stats

Rank indexes behind lock waits with operational stats, separate latches from locks, and test targeted access or row versioning fixes.

Read More
Gouache painting of two goats meeting on a narrow bridge with a small vermilion passing platform added to its side

Deadlock Victim Selection: Protect One Transaction

June 24, 2020
Pinal Dave
SQL Performance
Deadlock, SQL Lock, SQL Server Configuration, SQL Stored Procedure

Deadlock victim selection decides which of two blocked transactions SQL Server rolls back. This post shows the rules, sets DEADLOCK_PRIORITY on one procedure, reproduces a deadlock with two query windows, and shows what the setting cannot do. It ends with the two fixes that remove the deadlock itself.

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

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