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

Troubleshooting Guide: Error 3925 – Invalid Transaction Mark Name

Why This Error Happens

This error occurs when a user or application attempts to execute a BEGIN TRANSACTION or COMMIT TRANSACTION statement using a WITH MARK clause where the mark name explicitly begins with the reserved prefix LSN:. SQL Server reserves this specific prefix internally to identify Log Sequence Number references during restore operations, so the engine blocks any user-defined transaction mark that uses it to prevent ambiguity in the transaction log. This is typically caused by a scripting error, a poorly configured ETL job, or a migration script that was copied from a system restore procedure without modification.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Query

  • Check the SQL Server Error Log via SSMS (Object Explorer > Management > SQL Server Logs) or the Windows Event Viewer on Windows Server 2025 to find the exact timestamp of the failure.
  • Correlate the timestamp with recent job executions in the SQL Server Agent job history to pinpoint the specific stored procedure or script causing the conflict.

Step 2: Edit the Transaction Mark Syntax

  • Open the identified script in SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Locate the BEGIN TRAN [transaction_name] WITH MARK 'description' syntax.
  • Rename any mark description starting with LSN: to a neutral identifier, such as Mark_Process_Start or PreUpdate_Backup.
  • Ensure the corrected syntax looks like this: BEGIN TRANSACTION MyTransaction WITH MARK 'Mark_Process_Start';

Step 3: Update Application Connection Strings and ORM Mappings

  • If the error originates from an application (e.g., .NET or Java app) rather than a raw T-SQL script, search the application’s source code or configuration files for hardcoded transaction names.
  • Update the application logic to use a dynamic naming convention (e.g., appending a GUID) that avoids reserved keywords entirely.
  • Redeploy the application or restart the specific Windows Service associated with the application pool to apply the code changes.

Step 4: Restart SQL Server Service (If Required)

  • If the error persists due to a cached execution plan, open Services.msc on the Windows Server 2025 host.
  • Locate SQL Server (MSSQLSERVER) or the specific named instance.
  • Right-click and select Restart to clear the plan cache and ad-hoc query cache.

Alternative or Verification Steps

  • Verification: Re-run the specific transaction or SQL Agent job manually in SSMS. If the transaction commits successfully without throwing Error 3925, the fix has been applied correctly.
  • Alternative: If modifying the source script is not immediately possible, use SQL Server Extended Events to trace the error_reported event filtered by Error Number 3925 to automatically log which specific login or application is violating the naming convention for future auditing.