SQL Server Distributed Transaction Error with SQLNCLI11
Full technical deep-dive into OLE DB provider "SQLNCLI11" unable to begin a distributed transaction.
Covers all versions from SQL Server 2005 to 2022 with actionable solutions, automation scripts, and real-world cases.
1. Error Overview
When executing a distributed transaction across linked servers in SQL Server — for example, using BEGIN DISTRIBUTED TRANSACTION or performing multi‑table updates that span instances — you may encounter this notorious error:
Msg 7391, Level 16, State 2, Line 1
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "LinkedServerName" was unable to begin a distributed transaction.
This indicates that the Microsoft Distributed Transaction Coordinator (MSDTC) cannot orchestrate the transaction between the two (or more) SQL Server instances. It is not a SQL Server internal problem but rather an OS‑level, network, or security configuration issue.
SQLNCLI11 refers to SQL Server Native Client 11.0 (default from SQL Server 2012 onward). The same root causes apply to older providers (SQLNCLI, SQLOLEDB) and newer ones (MSOLEDBSQL). This guide covers all.
2. Root Causes
The error stems from one or more of these typical culprits:
- MSDTC service not started or not configured for network transactions.
- Firewall blocking TCP port 135 (RPC Endpoint Mapper) and the dynamic or static port range used by MSDTC.
- Linked server option
remote proc transaction promotionset tofalse. - Insufficient permissions for the SQL Server service account or the login used in the linked server.
- Name resolution failure between participating servers (hostname cannot be resolved).
- Mixed authentication or Kerberos delegation issues in domain environments.
- Different SQL Server versions or provider mismatches (e.g., using SQLNCLI11 against an older instance).
We'll systematically address each cause in the following sections.
3. MSDTC Deep Configuration (Core)
MSDTC must be correctly configured on every instance that participates in distributed transactions.
3.1 Service Status
Ensure the Distributed Transaction Coordinator service is running and set to Automatic start.
# PowerShell
Get-Service MSDTC
Start-Service MSDTC
Set-Service MSDTC -StartupType Automatic
3.2 Security Settings (dcomcnfg)
Open Component Services (dcomcnfg) → Component Services → Computers → My Computer → right-click Properties → MSDTC tab → Security Configuration.
- Network DTC Access: ✅
- Allow Remote Clients: ✅
- Allow Inbound: ✅
- Allow Outbound: ✅
- Enable XA Transactions: ✅ (recommended for legacy apps)
- Authentication: Choose Mutual Authentication (domain) or Incoming Caller Authentication (workgroup).
After changes, restart MSDTC.
Restart-Service MSDTC -Force
You can also configure these settings via the registry (useful for automation):
# Enable network DTC access and inbound/outbound
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "NetworkDtcAccess" -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "NetworkDtcAccessClients" -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "NetworkDtcAccessInbound" -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "NetworkDtcAccessOutbound" -Value 1
Restart-Service MSDTC
4. Firewall & Port Configuration
MSDTC uses TCP 135 (RPC Endpoint Mapper) plus a range of dynamic TCP ports (usually 1024–65535). To simplify firewall rules, assign a fixed port range.
4.1 Fixed Port Range (Recommended)
Set a dedicated port range (e.g., 5000–5100) in the registry, then open those ports in the firewall.
# Set port range (run as Administrator)
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "Ports" -Value "5000-5100" -PropertyType String -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "PortsEnabled" -Value 1 -PropertyType DWord -Force
Restart-Service MSDTC -Force
Now, open TCP 135 and TCP 5000–5100 inbound/outbound on each server.
4.2 Name Resolution
Each server must be able to resolve the other's hostname (DNS or hosts file).
# Test resolution
ping ServerName
nslookup ServerName
dtcping (available from Microsoft) to test MSDTC connectivity and pinpoint firewall/RPC issues.
5. Linked Server Configuration
The linked server must have the “Enable Promotion of Distributed Transactions” option set to true (default).
-- Check current setting
SELECT name, remote_proc_trans_promotion FROM sys.servers WHERE name = 'LinkedServerName';
-- Enable if disabled
EXEC sp_serveroption 'LinkedServerName', 'remote proc transaction promotion', 'true';
Also verify that the OLE DB provider supports distributed transactions. For SQLNCLI11, it does; but if you're using older SQLOLEDB, consider upgrading to MSOLEDBSQL.
OPENQUERY or EXEC AT may not automatically promote to a distributed transaction. If you explicitly use BEGIN DISTRIBUTED TRANSACTION, then all requirements must be met.
6. Permissions & Security
The SQL Server service account must have local DCOM permissions to launch and activate MSDTC.
- Open dcomcnfg → Component Services → Computers → My Computer → DCOM Config → find
MSDTC→ right-click Properties → Security → Launch and Activation Permissions → Add the SQL Server service account with Local Launch and Local Activation. - Similarly, in Access Permissions, grant Local Access.
For workgroup environments, you may need to use the same local username/password on both servers or rely on SQL Server authentication. Also, ensure the linked server's login mapping has appropriate permissions on the remote instance.
7. Version-by-Version Differences
While the core solution remains similar, each SQL Server version has subtle differences in providers, default settings, and tooling.
| SQL Version | Default OLE DB Provider | MSDTC Config Interface | Special Notes |
|---|---|---|---|
| 2005 | SQLNCLI (older) | dcomcnfg | May require installation of SQL Server Native Client. |
| 2008 / 2008 R2 | SQLNCLI10 | dcomcnfg | Upgrade to SQLNCLI11 recommended for better support. |
| 2012 / 2014 | SQLNCLI11 | dcomcnfg / PowerShell | Windows Server 2012 has stricter MSDTC security defaults. |
| 2016 / 2017 | SQLNCLI11 (still default) | dcomcnfg / PowerShell | Consider switching to MSOLEDBSQL for improved stability. |
| 2019 / 2022 | MSOLEDBSQL (recommended) | dcomcnfg / PowerShell | MSOLEDBSQL has better distributed transaction support and performance. |
Recommendation: For SQL Server 2016+, migrate linked servers to use Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL).
-- Change provider for a linked server
EXEC sp_addlinkedserver
@server = 'LinkedServerName',
@srvproduct = '',
@provider = 'MSOLEDBSQL',
@datasrc = 'RemoteServer\Instance';
8. Automated Diagnostic Scripts (PowerShell)
Here is a comprehensive PowerShell script to check MSDTC status, registry settings, firewall rules, and connectivity on each server.
# Check MSDTC service
Get-Service MSDTC
# Verify security registry keys
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" |
Select-Object NetworkDtcAccess, NetworkDtcAccessClients,
NetworkDtcAccessInbound, NetworkDtcAccessOutbound
# List firewall rules related to DTC
Get-NetFirewallRule -DisplayName "*DTC*" | Select DisplayName, Enabled, Direction
# Read configured port range
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSDTC\Security" -Name "Ports" -ErrorAction SilentlyContinue
# Test RPC connectivity (requires dtcping.exe from Microsoft)
# dtcping -Computer RemoteServerName
CheckDTC.ps1 and run it on every SQL Server with administrative privileges. Compare outputs to spot mismatches quickly.
9. Real-World Incident & Resolution
Investigation steps:
- Checked SQL error logs — confirmed error 7391.
- MSDTC service was running on both servers, but Allow Remote Clients was unchecked on the DR site.
- Firewall audit revealed that TCP 135 was blocked by the new domain policy.
- Name resolution: the DR server could not resolve the primary server's hostname (DNS record missing). Added a hosts file entry.
- Reconfigured MSDTC security, opened the required ports, and restarted the service.
- Distributed transactions resumed immediately.
Lesson: Always revalidate MSDTC and firewall settings after infrastructure changes. Use fixed MSDTC ports to avoid firewall headaches.
10. Advanced FAQ
Q1: I'm using SQL Server 2019 but still see SQLNCLI11 in the error. How to switch to MSOLEDBSQL?
A: Change the provider in the linked server properties. You can use sp_addlinkedserver with @provider='MSOLEDBSQL'. Ensure the MSOLEDBSQL driver is installed (download from Microsoft).
Q2: I've configured MSDTC but the error persists. What else can I check?
A: Check Windows Event Logs (Application and System) for MSDTC errors. Use dtcping to test bi‑directional connectivity. Verify the SQL Server service account has DCOM permissions (Local Launch, Local Activation). Also, confirm that both servers are in the same domain or have proper trust.
Q3: How do I handle this in a workgroup environment?
A: In a workgroup, you must use identical local user credentials (same username/password) on both servers, or use SQL Server authentication. Set MSDTC authentication to No Authentication Required and open all necessary ports. This is less secure, so use only in isolated environments.
Q4: Can I run cross‑server transactions without MSDTC?
A: Single‑statement operations (e.g., SELECT or UPDATE without explicit transactions) do not require MSDTC. However, multi‑step transactions that span servers need MSDTC. Consider using linked server with SET XACT_ABORT ON and handling errors manually, but this is not a replacement.
Q5: Does this error affect SQL Server on Linux?
A: SQL Server on Linux supports distributed transactions via MSDTC only when integrated with Windows-based MSDTC (using a companion Windows server). Native Linux DTC support is limited. Check Microsoft's documentation for specific Linux configurations.
11. Summary & Best Practices
Resolving the SQLNCLI11 unable to begin a distributed transaction error boils down to a disciplined checklist:
- ✅ Start MSDTC and set to automatic on all nodes.
- ✅ Enable network DTC access, inbound/outbound, and remote clients.
- ✅ Open TCP 135 and the MSDTC port range in the firewall.
- ✅ Ensure proper name resolution (DNS/hosts).
- ✅ Set linked server option
remote proc transaction promotionto true. - ✅ Grant DCOM launch/activation permissions to the SQL Server service account.
- ✅ For modern SQL Server, migrate to MSOLEDBSQL provider.
- ✅ Use PowerShell scripts to automate diagnostics and validation.
— FreeLearning365 • Empowering IT professionals with actionable knowledge.

0 Comments
thanks for your comments!