How to fix Error 3920 on Windows Server 2025 / Windows 11

Why This Error Happens

Error 3920 occurs because SQL Server only allows a single transaction mark to be written to the transaction log per connection/transaction nesting level. When a BEGIN TRAN WITH MARK statement is issued while another marked transaction is already open (nested transactions), the engine silently ignores the second WITH MARK clause and raises this informational error instead of failing the batch. This is commonly triggered by stored procedures or application code that re-enters a transaction block, or by a database recovery model (Simple) that doesn’t fully support log marking in the way the application expects.

Step-by-Step Resolution Guide

Step 1: Check the Database Recovery Model

  • Open SSMS and connect to the SQL Server 2025 instance.
  • Run the following query to confirm the model:
    SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'YourDB';
  • If the result shows SIMPLE, switch it to FULL or BULK_LOGGED since marked transactions are only fully honored in these models:
    ALTER DATABASE YourDB SET RECOVERY FULL;

Step 2: Audit the Code for Nested BEGIN TRAN WITH MARK Statements

  • Search all stored procedures, triggers, and application connection strings for multiple BEGIN TRAN WITH MARK calls within the same session or call stack.
  • Use this query to locate the mark history and confirm duplicates:
    SELECT * FROM msdb.dbo.logmarkhistory WHERE database_name = 'YourDB' ORDER BY mark_time DESC;
  • Refactor the code so only the outermost transaction in the batch uses the WITH MARK clause; inner transactions should use plain BEGIN TRAN.

Step 3: Verify Transaction Isolation and Connection Reuse

  • Check @@TRANCOUNT before issuing a new BEGIN TRAN WITH MARK to ensure you are not already inside an active transaction:
    IF @@TRANCOUNT = 0 BEGIN TRAN MyMark WITH MARK 'Description';
  • On Windows Server 2025/Windows 11 clients, confirm connection pooling in the application (ODBC/OLE DB driver settings in ODBC Data Source Administrator) isn’t reusing a session that still holds an open marked transaction.

Step 4: Apply the Fix and Restart the Session

  • Close and reopen the SSMS query window or application connection to clear any lingering transaction state.
  • Re-run the corrected script with a single BEGIN TRAN WITH MARK at the top level.

Alternative or Verification Steps

  • Verify the fix by querying msdb.dbo.logmarkhistory after running the corrected transaction — only one mark entry should appear per logical operation, with no Error 3920 raised in the Messages tab.
  • If the issue persists, as an alternative, use explicit named transactions (BEGIN TRAN TranName WITH MARK) combined with SET XACT_ABORT ON to force clean transaction boundaries and prevent accidental nesting.