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

Why This Error Happens

This error typically occurs when the OLE DB provider (MSOLEDBSQL or SQLOLEDB) registry entries are corrupted, missing, or mismatched with the version of SQL Server 2025 installed. It can also arise from a botched in-place upgrade where COM components didn’t re-register correctly, or from 32-bit/64-bit DLL conflicts where an application attempts to load an incompatible bitness of the OLE DB library. Insufficient permissions on the DLL files or registry keys under HKEY_CLASSES_ROOT\CLSID can also prevent SQL Server from initializing the provider at startup.

Step-by-Step Resolution Guide

Step 1: Verify OLE DB Provider Installation

  • Navigate to C:\Windows\System32 and confirm msoledbsql.dll (or sqlncli11.dll for legacy compatibility) exists and is not zero-byte or corrupted.
  • Check installed versions via PowerShell: Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\MSOLEDBSQL"
  • If missing, download and reinstall the latest Microsoft OLE DB Driver for SQL Server matching your CPU architecture (x64).

Step 2: Re-register the OLE DB DLL

  • Open an elevated Command Prompt (Run as Administrator).
  • Run: regsvr32 /u msoledbsql.dll to unregister the corrupted entry.
  • Run: regsvr32 msoledbsql.dll to re-register it cleanly.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Repair the SQL Server Installation

  • Launch SQL Server 2025 Setup from the installation media or Control Panel > Programs and Features.
  • Select the instance experiencing the error and choose the Repair option rather than a full reinstall.
  • Allow the setup wizard to detect and fix missing or corrupted shared components, including OLE DB dependencies.

Step 4: Check for 32-bit vs 64-bit Conflicts

  • If the calling application is 32-bit, ensure the 32-bit OLE DB provider is installed alongside the 64-bit version (found under C:\Windows\SysWOW64).
  • Update the connection string or linked server configuration to explicitly reference the correct provider name (e.g., MSOLEDBSQL19 vs. legacy SQLOLEDB).

Alternative or Verification Steps

  • After applying fixes, test the connection using sqlcmd -S <ServerName> -E or attempt to create a Linked Server in SSMS pointing to the local instance to confirm the provider loads without Error 516.
  • If the issue persists, use Process Monitor (ProcMon) filtered by msoledbsql.dll to trace exactly which file or registry access is being denied during SQL Server startup.