0X00001A40

Fix 0x1A40 Transaction Manager Name Collision on SQL Server

Database Errors Intermediate 👁 1 views 📅 May 28, 2026

This error fires when two databases on the same SQL Server have matching filenames in the transaction log, confusing recovery. Here's the fix.

You're restarting SQL Server after a crash, or maybe attaching a database from a backup, and you get ERROR_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION (0x00001A40). The server won't start. You check the error log and see something like 'Two databases have the same log file name'. This happens most frequently when somebody copies a database file (.mdf) and log file (.ldf) from another server without renaming the log file first. The transaction manager sees a duplicate name—same database ID collision in the log stream—and refuses to run recovery because it can't tell the two apart.

Root Cause

Every SQL Server database has a unique database ID inside the log file header. When two databases try to use the same log file name (the physical file name on disk, like C:\Data\MyDB_log.ldf), the recovery process sees that the log sequence numbers conflict. It's like two people showing up with the same passport number. The system panics, throws 0x1A40, and stops. This isn't a permissions issue or a corrupted disk—it's a naming collision inside the transaction manager's internal tables.

The Fix

  1. Identify the two databases. You need the names of both databases that share the log file name. Run this query in SQL Server Management Studio (SSMS) on a working instance:
    SELECT name, physical_name FROM sys.master_files WHERE type_desc = 'LOG';
    Look for two entries where physical_name is identical. That's your problem pair.
  2. Take one database offline. You can't rename a log file while the database is online. Right-click the duplicate database in SSMS, choose TasksTake Offline. If the server won't start at all, you'll need to start it in single-user mode with NET START MSSQLSERVER /f from command prompt. Then connect with sqlcmd and run:
    ALTER DATABASE [YourDB] SET OFFLINE;
  3. Rename the physical log file. Navigate to the folder where the .ldf files live. Right-click the log file of the offline database, rename it (e.g., MyDB_log.ldfMyDB_log_new.ldf). Keep the same extension. SQL Server doesn't care what the filename is, as long as it's unique.
  4. Update SQL Server's metadata. Still connected to the server, run:
    ALTER DATABASE [YourDB] MODIFY FILE (NAME = YourDB_log, FILENAME = 'C:\Data\MyDB_log_new.ldf');
    Replace the path with your actual path. After this, SQL Server knows the file moved.
  5. Bring the database back online. Run:
    ALTER DATABASE [YourDB] SET ONLINE;
    Recovery should complete without the collision error. The server will start normally now.

If It Still Fails

Sometimes the error persists because the transaction manager has a cached reference. Force a full restart of the SQL Server service after the rename. If that doesn't work, check for a third database that also has the same log file name—rare but possible when someone bulk-attaches databases from a script. Also verify the file path is correct in step 4—typos are common. If you still get 0x1A40, you can detach the problem database, delete the old .ldf file, and re-attach it. SQL Server will create a fresh log file with a unique name. That's the nuclear option, but it works 100% of the time.

Was this solution helpful?