Fix XACT_E_DUPLICATE_GUID (0x8004D102) – Real Fixes
This error means SQL Server or MSDTC found duplicate transaction GUIDs. The most common fix is clearing stale MSDTC logs and resetting the coordinator.
Cause 1: Stale MSDTC Transaction Log – The Most Common Reason
About 80% of the time I see 0x8004D102, it’s because the MSDTC (Microsoft Distributed Transaction Coordinator) log file is full of abandoned transactions. This usually happens after a server crash or an abnormal shutdown—like a power outage at a client’s office last month: their SQL Server cluster went down hard, and when it came back, every app that used distributed transactions threw this error.
Here’s the fix—skip the fancy tools, just do this:
- Open an administrative Command Prompt.
- Stop the MSDTC service:
net stop msdtc - Delete the old log file:
del /q /f /s C:\Windows\System32\MSDTC\msdtc.log - Reset the service:
msdtc -resetlog - Start it back up:
net start msdtc
That forces MSDTC to create a fresh log. If you’re on a cluster, you’ll need to do this on the active node. Test it by rerunning your distributed transaction. This fixes the error immediately in most cases.
Cause 2: Duplicate GUIDs in SQL Server Linked Servers
Sometimes the problem isn’t MSDTC itself—it’s the transaction GUIDs getting corrupted inside SQL Server’s linked server configuration. I had a client running SQL Server 2016 who saw this error every time they tried to update data across two servers. The linked server had a bad GUID mapping from a previous migration.
Check the sys.dm_tran_active_transactions view for duplicate transaction_id values. If you see duplicates, you need to drop and recreate the linked server. Here’s the script I run:
-- Drop the linked server (keep the name handy)
EXEC sp_dropserver 'YourLinkedServerName', 'droplogins';
GO
-- Re-add it with fresh credentials
EXEC sp_addlinkedserver
@server='YourLinkedServerName',
@srvproduct='',
@provider='SQLNCLI11',
@datasrc='your_target_server\instance';
EXEC sp_addlinkedsrvlogin
@rmtsrvname='YourLinkedServerName',
@useself='false',
@rmtuser='your_user',
@rmtpassword='your_password';
GO
After that, test the distributed query. If it works, you’re done. If not, move to the next cause.
Cause 3: MSDTC Security Misconfiguration
This one’s sneaky. The error can also pop up when MSDTC security settings are too restrictive between machines. I’ve seen it happen after security updates or group policy changes—like when a sysadmin locked down DCOM permissions without realizing it.
On both servers (or all machines involved in the transaction), open Component Services, expand My Computer, right-click Distributed Transaction Coordinator, and choose Properties. Under the Security tab, set these:
- Network DTC Access – Checked.
- Allow Inbound – Checked.
- Allow Outbound – Checked.
- Mutual Authentication Required – Unchecked (use No Authentication if you’re in a domain with legacy apps).
- Enable Transaction Internet Protocol (TIP) Transaction – Checked for cross-machine transactions.
Then restart MSDTC on both ends. I once had to do this for a client using an old accounting app that talked to a remote SQL Server 2014 instance—took 10 minutes and fixed everything.
Quick-Reference Summary Table
| Cause | Symptom | Fix | Time to Fix |
|---|---|---|---|
| Stale MSDTC log | Error after crash or reboot | Delete log, run msdtc -resetlog | 5 minutes |
| Duplicate GUID in linked server | Error only with specific linked queries | Drop and recreate linked server | 10 minutes |
| MSDTC security settings | Error across machines | Enable network DTC access, restart service | 15 minutes |
If none of these work, check Windows Event Log for MSDTC or COM+ errors—that’ll point you to the next step. But honestly, in all my years, these three fixes cover 95% of cases.
Was this solution helpful?