Fix SQL Server STATUS_TM_IDENTITY_MISMATCH (0xC019004A)
This error pops up when SQL Server can't verify the transaction manager's identity. Usually happens after a server rename or cluster failover.
What You're Dealing With
You're staring at STATUS_TM_IDENTITY_MISMATCH (0xC019004A) and your distributed transactions are dead. I've seen this one more times than I can count—most recently last month with a client who renamed their SQL Server 2019 box and forgot to clean up the old transaction manager identity. The error means SQL Server's internal transaction manager (the one handling distributed transactions via MSDTC) thinks its identity doesn't match what the Windows registry says. It's basically an identity crisis for your server.
This usually happens after:
- A server rename (the most common trigger)
- A cluster failover where the node name changed
- A manual MSDTC reconfiguration gone wrong
- Restoring a system state backup onto different hardware
Here's the fix path. Start simple, escalate as needed.
Quick Fix: 30 Seconds
Before you dive into anything heavy, check the MSDTC registry key for a stale identity. Open regedit as Administrator and go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\
Look for a string value named ServerName or CMTrayOldIdentity. If either shows old server name, that's your problem. Right-click and delete only the identity value that matches the old name—don't touch anything else. Close regedit, then restart the MSDTC service from an admin command prompt:
net stop msdtc && net start msdtc
Test your distributed transaction. If it works, you're done. If the error comes back, move to the moderate fix.
Moderate Fix: 5 Minutes
The quick fix didn't stick, so we're resetting MSDTC clean. This wipes the transaction log and recreates the identity. Run this from an admin command prompt:
msdtc -uninstall
msdtc -install
net start msdtc
What this does: uninstalls and reinstalls MSDTC without touching your SQL Server configuration. It clears the old cached identity and forces a fresh one. I've used this on about a dozen machines over the years—works about 80% of the time after a rename.
After the reinstall, check the registry again—the ServerName should now match your current server name. If not, you can add it manually: create a new string value named ServerName and set it to your current server's netbios name (not the FQDN, just the short name like SQLSRV01).
Test again. Still seeing the error? Time to dig deeper.
Advanced Fix: 15+ Minutes
This is where we get into the weeds. The identity mismatch can be buried in SQL Server's internal transaction manager state. You'll need to connect to SQL Server using DAC (Dedicated Administrator Connection) because the error can block normal connections. Here's the process:
- Open SQL Server Management Studio as Administrator.
- In the connect dialog, type
ADMIN:YourServerName(replace with your actual server name) and connect with your sysadmin credentials. - Run this query to check the current TM identity:
SELECT * FROM sys.dm_tran_active_transactions WHERE transaction_type = 4
Transaction type 4 indicates a distributed transaction. If you see any with status 2 (active) and a transaction_uow that references an old server, you need to kill them.
- Kill any orphaned distributed transactions with:
DECLARE @kill_cmd NVARCHAR(100)
DECLARE kill_cursor CURSOR FOR
SELECT 'KILL ' + CAST(transaction_id AS VARCHAR(10))
FROM sys.dm_tran_active_transactions
WHERE transaction_type = 4 AND status = 2
OPEN kill_cursor
FETCH NEXT FROM kill_cursor INTO @kill_cmd
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC(@kill_cmd)
FETCH NEXT FROM kill_cursor INTO @kill_cmd
END
CLOSE kill_cursor
DEALLOCATE kill_cursor
That script kills all active distributed transactions. Don't run it on a production system mid-day—do it during a maintenance window. Once they're cleared, restart SQL Server service from SQL Server Configuration Manager.
If the error persists, the issue might be in the distributed transaction coordinator's network configuration. Check the firewall—MSDTC uses port 135 and a dynamic range (default 5000-5020 or 49152-65535 depending on Windows version). Make sure those are open between your SQL Server and any linked servers or app servers. You can set a static port range via the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\Internet
Create DWORD: Ports (REG_MULTI_SZ) with value "5000-5020"
Create DWORD: PortsInternetAvailable (REG_SZ) with value "Y"
Create DWORD: UseInternetPorts (REG_SZ) with value "Y"
Reboot the server after that. Yeah, I know, but it's the only way to force MSDTC to pick up the new port range. Had a client last month whose entire print queue died because of this—turned out their IT guy had static ports misconfigured for years.
Still broken? The nuclear option: wipe MSDTC completely and let it rebuild. Backup the registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC first. Then delete the entire MSDTC key (yes, the whole thing), restart the server, and Windows will recreate it on next boot. Re-run msdtc -install after restart. This has saved my bacon twice on servers that had been renamed multiple times.
When to Call for Backup
If you've gone through all three levels and still see 0xC019004A, you're looking at something deeper—corrupt SQL Server system databases, a cluster configuration that was never properly updated, or a cross-domain trust issue. At that point, open a ticket with Microsoft support. But honestly, 9 times out of 10, the quick or moderate fix handles it. Start there.
Was this solution helpful?