SQL Server error 7399 ("The OLE DB provider for linked server could not be found in OLE DB providers") occurs when a linked server configuration fails to locate its required provider. This usually happens after a provider is uninstalled or the linked server is misconfigured. Fixing it requires revalidating the linked server connection or reinstalling the appropriate OLE DB provider. The simplest solution is to run sp_server_option with the revalidate option, followed by verifying the provider in SQL Server Configuration Manager.
What You'll Need
- Administrator privileges on SQL Server
- SQL Server Management Studio (SSMS) or a T-SQL client
- The original OLE DB provider installed (e.g., SQLNCLI11 for .NET Framework, MSDASQL for legacy systems)
- Access to SQL Server Configuration Manager (on the SQL Server machine)
- For remote linked servers: network connectivity to the remote server and valid credentials
Step-by-Step
- Restart SQL Server services (simplest first step):
- Open SQL Server Configuration Manager (search for it in Windows Start menu).
- Expand SQL Server Services and find your SQL Server instance (e.g., "SQL Server (MSSQLSERVER)").
- Right-click the service and select Restart. Wait for the services to fully restart.
This clears temporary connection issues without requiring provider reinstalls.
- Revalidate the linked server using T-SQL:
- Open SSMS and connect to your SQL Server instance.
- Run the following command for the affected linked server (replace
[LinkedServerName]with your server name):EXEC sp_server_option '[LinkedServerName]', 'rpc out', false; - Then re-enable RPC:
EXEC sp_server_option '[LinkedServerName]', 'rpc', true; - Finally, revalidate the linked server:
EXEC sp_server_option '[LinkedServerName]', 'revalidate', true;
This forces SQL Server to recheck the provider connection without deleting the linked server.
- Verify the OLE DB provider is installed:
- Open SQL Server Configuration Manager and navigate to Configuration Files > SQL Server 20XX Native Client Configuration (where XX matches your version).
- Under Providers, ensure the provider for your linked server appears (e.g., SQLNCLI for SQL Server, MSDASQL for ODBC-linked servers).
- If missing, reinstall the provider:
- Download the correct provider from Microsoft's website (e.g., SQL Native Client for older systems).
- Run the installer as Administrator and select "Add/Remove Features" to repair existing installations.
Common providers:
- SQLNCLI (for SQL Server 2008+)
- MSDASQL (for ODBC-based linked servers)
- SQLOLEDB (legacy)
- Recreate the linked server if revalidation fails:
- In SSMS, right-click Server Objects > Linked Servers and select Delete to remove the problematic linked server.
- Right-click again and choose New Link Server.
- Enter the server name, select the correct provider (e.g., Microsoft OLE DB Provider for SQL Server), and complete the wizard.
- Test the connection after creation by running a simple query like:
SELECT 1 FROM OPENQUERY([LinkedServerName], 'SELECT 1')
This ensures all configuration settings are fresh.
- Check SQL Server error logs for additional clues:
- In SSMS, right-click the server instance and select View Error Log.
- Search for entries with timestamp close to when the error occurred.
- Look for lines containing "OLE DB" or the provider name (e.g., "SQLNCLI") to identify missing dependencies.
Example log snippet to watch for:
Error: 7399, Severity: 20, State: 9: Could not find OLE DB provider 'SQLNCLI' - Update SQL Server and drivers:
- Check for updates in SQL Server Management Studio > Tools > Check for Updates.
- Update the OLE DB provider separately if needed:
- For SQL Server 2016+, use SQL Server 2016 Feature Pack or later.
- For older versions, download the standalone provider from Microsoft's archives.
Newer provider versions often include bug fixes for linked server connectivity.
Common Mistakes
- Skipping provider validation: Assuming the provider is installed when it isn't. Always verify in SQL Server Configuration Manager before troubleshooting.
- Using incorrect provider names: Mixing up
SQLNCLI(OLE DB) withSQLNCLI11(ODBC). The OLE DB provider name must match exactly. - Not restarting services after provider changes: Changes to OLE DB providers require a service restart to take effect.
- Overlooking firewall rules: Network-level blocks (e.g., SQL Server ports 1433/1434) can mimic provider errors.
- Recreating linked servers without testing: Always test the connection after recreation to confirm the fix.
- Ignoring case sensitivity in provider names: The provider name must match exactly, including case (e.g.,
SQLNCLIvssqlncli).
Tips
- Document provider versions: Note the exact version of the OLE DB provider you use (e.g.,
SQLNCLI11 for SQL Server 2016 (SP1)). This helps recreate environments later. - Use sp_help_providers to list all available providers:
EXEC sp_help_providers;This shows which providers are registered on your system. - Test with a minimal query: After fixing, run
SELECT * FROM OPENQUERY([LinkedServer], 'SELECT TOP 1 * FROM sys.tables')to verify basic connectivity. - Check linked server properties: Right-click the linked server in SSMS and inspect the Server Options tab for misconfigurations (e.g., incorrect RPC settings).
- Use ODBC as a fallback: If OLE DB fails, configure an ODBC-based linked server using MSDASQL as the provider.
- Enable detailed errors: Set SQL Server to log more detailed OLE DB errors by modifying
sp_configure 'Show Advanced Options', 1;andRECONFIGURE;in a separate session.
Troubleshooting
If the error persists after following the steps above, proceed methodically:
- Check for missing .NET Framework components:
- SQL Server linked servers often require .NET Framework 4.5 or later. Install it from Microsoft's website if missing.
- Verify via Control Panel > Programs > Turn Windows features on or off and ensure .NET Framework 4.5 (or higher) is enabled.
- Isolate the provider issue:
- Create a test linked server to a known-working SQL Server using the same provider.
- If this works, the original linked server configuration is likely corrupted.
- If it fails, the provider itself is missing or damaged.
- Reinstall the SQL Server client components:
- Run the SQL Server setup executable (from the installation media or ISO).
- Choose Installation > New SQL Server stand-alone installation or add features to an existing installation.
- On the Feature Selection page, select Client Tools Connectivity and Management Tools - Complete.
- Complete the installation. This reinstalls all client-side components, including OLE DB providers.
- Check Windows Registry for provider entries (advanced):
- Open regedit and navigate to
HKEY_CLASSES_ROOT\CLSID. - Search for keys related to the missing provider (e.g.,
SQLNCLI). - If keys are missing or corrupted, restore them from a working system or reinstall the provider.
Warning: Registry edits can break system stability. Backup the registry before making changes.
- Open regedit and navigate to
- Use Process Monitor to diagnose:
- Download and run Process Monitor from Sysinternals.
- Filter for
SQLServer.exeand look forERROR_ACCESS_DENIEDorNAME_NOT_FOUNDevents when testing the linked server. - This reveals permission or path issues with the provider DLLs.
- Contact Microsoft Support if all else fails:
- Provide the exact error message and steps you've taken.
- Include the SQL Server version, provider version, and output of
sp_help_providers. - Check Microsoft's SQL Server support page for known issues.
Frequently Asked Questions
Why does error 7399 appear after a Windows update?
The issue typically stems from Windows updates removing or modifying OLE DB provider dependencies (e.g., .NET Framework components or COM registrations). Always verify provider registration and restart SQL Server after major Windows updates.
Can I use a different OLE DB provider for my linked server?
Yes, but the provider must support the linked server's data source. For example:
- SQL Server → Microsoft OLE DB Provider for SQL Server (SQLNCLI)
- Oracle → Oracle in OracleClient12Home1
- Excel → Microsoft.ACE.OLEDB.12.0
Will reinstalling SQL Server fix error 7399?
Reinstalling SQL Server will reinstall its client components, including OLE DB providers. However, this is a last resort—first try reinstalling only the Client Tools Connectivity feature during SQL Server setup. A full reinstall risks downtime and configuration loss.
How do I know if the provider is 32-bit or 64-bit?
The provider architecture must match the SQL Server instance's architecture:
- 32-bit SQL Server → Use 32-bit providers (e.g.,
C:\Windows\SysWOW64\odbcad32.exefor 32-bit ODBC) - 64-bit SQL Server → Use 64-bit providers (e.g.,
C:\Windows\System32\odbcad32.exefor 64-bit ODBC)
What if the linked server works in one environment but not another?
Environment-specific issues include:
- Missing DLLs on the target machine (e.g.,
SQLNCLI.dll) - Different provider versions (e.g., SQL Server 2016 provider on a 2019 server)
- Network policies blocking OLE DB traffic (ports 135, 1433, or dynamic ports)
- Authentication differences (e.g., Kerberos vs. NTLM)
sp_configure 'show advanced options', 1; RECONFIGURE; and check xp_instance_regread for provider registration differences.
Is there a way to automate linked server provider checks?
Yes, create a stored procedure to validate providers and linked servers:
CREATE PROCEDURE dbo.CheckLinkedServerProviders
AS
BEGIN
DECLARE @ProviderName NVARCHAR(255), @LinkedServer NVARCHAR(128);
DECLARE ProviderCursor CURSOR FOR
SELECT provider_name FROM sys.dm_os_loaded_modules WHERE module_name LIKE '%SQLNCLI%';
OPEN ProviderCursor;
FETCH NEXT FROM ProviderCursor INTO @ProviderName;
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Provider found: ' + @ProviderName;
FETCH NEXT FROM ProviderCursor INTO @ProviderName;
END
CLOSE ProviderCursor;
DEALLOCATE ProviderCursor;
DECLARE LinkedServerCursor CURSOR FOR
SELECT name FROM sys.servers WHERE is_linked = 1;
OPEN LinkedServerCursor;
FETCH NEXT FROM LinkedServerCursor INTO @LinkedServer;
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @Provider NVARCHAR(255);
SELECT @Provider = provider_name FROM sys.servers WHERE name = @LinkedServer;
PRINT 'Linked Server ' + @LinkedServer + ' uses provider: ' + ISNULL(@Provider, 'MISSING');
FETCH NEXT FROM LinkedServerCursor INTO @LinkedServer;
END
CLOSE LinkedServerCursor;
DEALLOCATE LinkedServerCursor;
END;
Run this periodically to audit your environment.