How to fix Error 7398 on Windows Server 2025 / Windows 11

Troubleshooting Guide: Error 7398 – OLE DB Provider Commit Failure on Linked Server

Why This Error Happens

Error 7398 occurs when the OLE DB provider used by a linked server fails to commit a distributed transaction, typically due to the Microsoft Distributed Transaction Coordinator (MSDTC) being disabled, misconfigured, or unreachable between the two servers. This can also happen if the linked server login lacks sufficient permissions on the remote data source, or if network-level security (firewalls, authentication protocols) blocks the two-phase commit process. In some cases, the OLE DB provider itself is outdated or has specific transaction-handling limitations that conflict with SQL Server 2025’s distributed transaction requirements.

Step-by-Step Resolution Guide

Step 1: Verify and Configure MSDTC Settings

  • Open Component Services (dcomcnfg.exe) on Windows Server 2025 / Windows 11.
  • Navigate to Component Services > Computers > My Computer > Distributed Transaction Coordinator > Local DTC.
  • Right-click Local DTC, select Properties, and go to the Security tab.
  • Ensure the following checkboxes are enabled: Network DTC Access, Allow Remote Clients, Allow Inbound, Allow Outbound, and No Authentication Required (or Mutual Authentication Required if both servers are domain-joined).
  • Restart the MSDTC service: net stop msdtc && net start msdtc.

Step 2: Validate Linked Server Permissions and Login Mapping

  • Open SQL Server Management Studio (SSMS) and expand Server Objects > Linked Servers.
  • Right-click the affected linked server, select Properties, then go to Security.
  • Confirm that a valid login mapping exists (avoid using “Be made using the login’s current security context” unless Kerberos delegation is properly configured).
  • Run the following T-SQL to test connectivity:
  EXEC sp_testlinkedserver 'YourLinkedServerName';

Step 3: Check Firewall and Network Port Configuration

  • Ensure port 135 (RPC) and the dynamic RPC port range (49152–65535 by default in Windows Server 2025) are open between both servers.
  • Run this PowerShell command on both machines to confirm the firewall rule is active:
  Get-NetFirewallRule -DisplayGroup "Distributed Transaction Coordinator" | Format-Table -AutoSize
  • If disabled, enable it:
  Enable-NetFirewallRule -DisplayGroup "Distributed Transaction Coordinator"

Step 4: Update or Reconfigure the OLE DB Provider

  • Go to Linked Server Properties > Provider Options in SSMS.
  • Enable Allow inprocess and disable Enlist OLE DB transactions if the provider does not fully support distributed transactions.
  • If using an older provider (e.g., SQLNCLI or MSDASQL), update to the latest Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL19) from the official Microsoft Download Center.

Alternative or Verification Steps

  • Run a manual BEGIN DISTRIBUTED TRANSACTION test query against the linked server to confirm commits succeed without triggering Error 7398.
  • If the issue persists, bypass distributed transactions entirely by using OPENQUERY instead of direct four-part naming (Server.Database.Schema.Table) for insert operations, as this avoids MSDTC enlistment altogether.