# 5 common SQL Server transaction problems (and how to solve them)

DevFeed: [5 common SQL Server transaction problems (and how to solve them)](<https://devfeed.tech/articles/5-common-sql-server-transaction-problems-and-how-to-solve-them-121149.md>)

Original publisher: [Read original article](<https://www.red-gate.com/simple-talk/databases/sql-server/5-common-sql-server-transaction-problems-and-how-to-solve-them/>)

Author: Sergey Gigoyan

Published: 2026-11-06T12:00:00Z

Content type: article

Language: en

Sources: [Simple Talk](<https://devfeed.tech/sources/simple-talk.md>)

Topics: [sql-server](<https://devfeed.tech/topics/sql-server.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [audit trail](<https://devfeed.tech/topics/audit-trail.md>)

Tags: [audit](<https://devfeed.tech/tags/audit.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [blocks](<https://devfeed.tech/tags/blocks.md>), [commit](<https://devfeed.tech/tags/commit.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [count](<https://devfeed.tech/tags/count.md>), [database](<https://devfeed.tech/tags/database.md>), [database-administration](<https://devfeed.tech/tags/database-administration.md>), [databases](<https://devfeed.tech/tags/databases.md>), [featured](<https://devfeed.tech/tags/featured.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [insert](<https://devfeed.tech/tags/insert.md>), [nested](<https://devfeed.tech/tags/nested.md>), [phantom](<https://devfeed.tech/tags/phantom.md>), [problems](<https://devfeed.tech/tags/problems.md>), [rollback](<https://devfeed.tech/tags/rollback.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [transaction](<https://devfeed.tech/tags/transaction.md>), [transactions](<https://devfeed.tech/tags/transactions.md>)

## AI overview

The excerpt presents five SQL Server transaction pitfalls and fixes. Under default READ COMMITTED, a count query waits for an open writer; NOLOCK or READ UNCOMMITTED avoids the wait by allowing dirty, potentially inaccurate reads. REPEATABLE READ holds shared locks on rows read so later statements in the transaction cannot see those rows changed. SERIALIZABLE prevents inserts into a read range, keeping repeated counts stable. A table variable retains audit data after rollback, allowing it to be written to the audit table afterward. Nested transactions do not make a plain ROLLBACK partial: it undoes the outer transaction too. SAVE TRANSACTION and rollback to its savepoint can preserve earlier audit work while undoing later work, though some errors leave the transaction uncommittable and prevent rollback to a savepoint. The excerpt cautions that authentication and audit design require care in real systems.

## Source excerpt

Five practical SQL Server transaction problems -- dirty reads, non-repeatable reads, phantom reads, rollback behavior, and nested transactions -- with fixes.... The post 5 common SQL Server transaction problems (and how to solve them) appeared first on Simple Talk.