Most common cause: MSDTC service isn't running or is misconfigured
What's actually happening here is your query needs a distributed transaction — either it touches multiple databases, or you're using linked servers, or you've got a transaction that spans two SQL Server instances. For that to work, Windows needs the Microsoft Distributed Transaction Coordinator (MSDTC) running and set up correctly. If MSDTC is stopped, disabled, or configured without network access, SQL Server throws 0X00001A3F right in your face.
I've seen this on fresh installs more times than I can count. The SQL Server installer sometimes doesn't start MSDTC automatically, or a Windows update resets the service startup type.
Check and start MSDTC
- Open
services.msc(Win+R, type it, hit Enter). - Find Distributed Transaction Coordinator.
- If it's not running, right-click and hit Start.
- Set startup type to Automatic (right-click → Properties).
If it starts but your error persists, you need to enable network DTC access. This is the step most people skip:
# Run as Administrator in PowerShell or CMD
dcomcnfg.exe
- In the Component Services window, expand Component Services → Computers → My Computer → Distributed Transaction Coordinator.
- Right-click Local DTC → Properties.
- Go to the Security tab.
- Check Network DTC Access.
- Under that, check Allow Inbound and Allow Outbound.
- Also check No Authentication Required if you're in a trusted domain (or if you're testing on a single box).
- Click OK and restart MSDTC.
That's the fix for 80% of cases. If you're still staring at 0X00001A3F, move on.
Second cause: SQL Server Agent or the SQL Service itself is in a weird state
Sometimes MSDTC is fine, but the SQL Server service that's supposed to coordinate with it isn't. If the SQL Server Agent is stopped, or the SQL Server service is stuck starting up, the transaction manager reports offline. This happens after a reboot when services start in the wrong order, or after a botched patch.
Restart SQL Server and SQL Server Agent
Don't just kill the service. Do it cleanly:
# From an elevated PowerShell
Restart-Service MSSQLSERVER
Restart-Service SQLSERVERAGENT
If your instance is named, the service names will be like MSSQL$INSTANCENAME and SQLAgent$INSTANCENAME. Find them with Get-Service | Where-Object {$_.Name -like '*SQL*'}.
After restarting, run your query again. If it still fails, check the SQL Server error log (in SSMS, right-click instance → Error Logs) for any messages about the transaction manager being unable to initialize. You'll often see something like “MSDTC initialiation failed” right before the 0x1A3F.
One more thing: if you're using a failover cluster or Always On Availability Groups, the transaction manager might be stuck on a node that's not the current primary. Failover to another node and see if the error disappears. I've seen that exact scenario on a two-node cluster where the MSDTC resource was pinned to the wrong node.
Third cause: Firewall or network misconfiguration blocking RPC and MSDTC ports
MSDTC uses RPC dynamic ports, and if your firewall is strict, the coordinators can't talk to each other. The error code doesn't tell you it's a network issue — it just says the transaction manager isn't online, which is technically true from your perspective.
This one bites you hard when you're connecting to a remote SQL Server from a client machine using linked servers or an SSIS package running on a different box.
Open the right ports
MSDTC needs TCP port 135 (RPC Endpoint Mapper) plus a range of dynamic ports. The cleanest approach is to set a fixed port for MSDTC:
# Set MSDTC port range (example: 5000-5020)
# In Component Services, right-click My Computer → Properties
# Go to the MSDTC tab → Security Configuration
# In the network settings, specify an incoming port range.
Then add firewall rules for TCP 135 and your port range. On Windows Server, you can do it with this PowerShell:
New-NetFirewallRule -DisplayName "MSDTC RPC" -Direction Inbound -Protocol TCP -LocalPort 135 -Action Allow
New-NetFirewallRule -DisplayName "MSDTC Dynamic" -Direction Inbound -Protocol TCP -LocalPort 5000-5020 -Action Allow
Also allow RPC Dynamic Ports in the firewall's program rules for dllhost.exe — that's the process that hosts MSDTC. If you're on a domain, check that the Windows Firewall profile is set to Domain rather than Public, because the public profile blocks a lot of RPC traffic.
After opening ports, restart MSDTC and test with a simple distributed transaction: BEGIN DISTRIBUTED TRANSACTION and then roll it back. If it completes, you're good.
Quick-reference summary
| Cause | Fix | Check |
|---|---|---|
| MSDTC not running or not network-enabled | Start service, enable Network DTC Access | services.msc → MSDTC status |
| SQL Server service stuck | Restart SQL Server and SQL Agent | Error log for MSDTC init failures |
| Firewall blocking RPC/MSDTC ports | Open TCP 135 + dynamic range, set fixed port | netstat -an for 135 |
That's the whole playbook. Start with MSDTC, because that's where 99% of the time the problem lives. If you've tried all three and still get 0X00001A3F, you're likely dealing with a corrupted MSDTC registry entry — which is a rare beast, and you'd want to reinstall the MSDTC component or do a system file check. But that's a story for another day.