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.
Counting Locks per Session With sys.dm_tran_locks
Count locks per session by resource and mode, connect open transactions, and recognize escalation while keeping snapshot limits clear.
READPAST Query Hint: Skip Locked Rows in SQL Server
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.
SQL SERVER – Getting Started with Accelerated Database Recovery – Instant Rollback
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.
Finding Long Open Transactions With sys.dm_tran_database_transactions
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.







