SQL Server Error 516: OLE DB Library Fix
In this article
SQL Server error 516 means the instance cannot load the OLE DB provider library it needs, usually because the provider is missing, not registered, or the wrong bitness for the SQL Server process. The fastest fix is to confirm which provider the failing query or linked server uses, install or register that provider on the SQL Server machine itself, and restart the SQL Server service so it picks up the change. This guide walks through that process in order, from the least invasive checks to a clean reinstall of the provider.
What You'll Need
- Administrative access to the Windows machine hosting SQL Server (local admin or equivalent).
- The name of the OLE DB provider involved — from the error text, the linked server definition, or the query that failed.
- The official installer for that provider from its vendor (for example, the Microsoft OLE DB Driver for SQL Server, or the vendor's own client package).
- Permission to restart the SQL Server service, ideally during a maintenance window.
- A way to run a quick test query (SSMS or sqlcmd) after each change.
Step-by-Step
- Read the full error message. Error 516 is often accompanied by a provider name or an HRESULT. Note the exact provider string (for example, MSOLEDBSQL, SQLNCLI, or a third-party name). That name determines everything that follows.
- Identify where the provider is being called. Check whether the failure comes from a linked server, an OPENROWSET/OPENQUERY statement, a SQL Server Agent job, or an SSIS package. In SSMS, expand Server Objects > Linked Servers and inspect the provider listed for the failing server. If the error appears only in a job, look at the job step's command text.
- Confirm the provider is installed on the SQL Server host. Do not check your workstation — the SQL Server service loads the provider on its own machine. Open Control Panel > Programs and Features and look for the provider's entry. If it is absent, install it from the vendor's official download page. Menu labels vary slightly by Windows version.
- Check bitness. A 64-bit SQL Server instance needs the 64-bit provider; a 32-bit instance needs the 32-bit provider. Installing only the 32-bit package on a 64-bit instance is a common cause of error 516. Install the matching architecture, and install both if you also run 32-bit tools such as some import wizards.
- Verify the provider is registered. Open Registry Editor and navigate to HKEY_CLASSES_ROOT\CLSID and search for the provider's ProgID (for example, MSOLEDBSQL). If the key is missing, the provider did not register during installation — rerun the installer with administrative rights and choose the repair option if offered.
- Restart the SQL Server service. In SQL Server Configuration Manager, select SQL Server Services, right-click the instance, and choose Restart. This forces the instance to reload provider libraries. Restarting drops current connections, so do it in a quiet period.
- Test with a minimal query. Run a simple linked-server query or the original statement in SSMS. If it succeeds, the fix is complete. If it still fails, capture the new error text — a different error number often points to a permissions or connection issue rather than a missing library.
- If the provider is a third-party one, reinstall it cleanly. Uninstall the provider, reboot if prompted, then reinstall the current official version. Third-party providers sometimes leave stale registry entries that break loading after an upgrade.
Common Mistakes
- Installing the provider on the client PC instead of the SQL Server host. The service loads the library locally, so the host is what matters.
- Mixing 32-bit and 64-bit installers. Match the SQL Server instance's architecture exactly.
- Forgetting to restart the service after installation. The instance will not see a newly installed provider until it restarts.
- Assuming error 516 is always a missing provider. It can also mean the provider is present but blocked by permissions or a corrupted registration; check the full message before reinstalling.
- Changing linked server settings without recording the original values, which makes rollback harder if the change does not help.
Tips
- Prefer the current Microsoft OLE DB Driver for SQL Server over the older SQL Server Native Client, which is deprecated and no longer receives updates.
- Keep a note of which provider and version each linked server uses, so future upgrades are predictable.
- Test changes on a non-production instance first when possible.
- If the provider is only needed for one job, consider whether a different connection method (such as an ODBC driver) would be simpler and better supported.
Troubleshooting
If the error persists after installing and restarting, work through these checks in order:
- Re-read the error text for an HRESULT or provider name you may have missed.
- Confirm the SQL Server service account has read access to the provider's installation folder and registry keys.
- Check Windows Event Viewer under Windows Logs > Application for provider load failures at the time of the error.
- Try a minimal test: create a temporary linked server to a known-good source using the same provider. If that works, the problem is in the original linked server's configuration, not the library.
- If a recent Windows or SQL Server update preceded the error, review what changed and consider rolling back the provider to its previous official version.
- As a last resort, uninstall and reinstall the provider, then restart the service again. Back up linked server definitions first if you will recreate them.
Frequently Asked Questions
What does error 516 actually mean?
It means SQL Server could not initialize the OLE DB library — typically because the provider is not installed, not registered, or the wrong bitness for the instance.
Do I install the provider on my PC or the server?
On the machine running SQL Server. The service loads the provider locally, so a client-side install will not fix the error.
Can I fix it without restarting SQL Server?
Usually not. The instance caches loaded libraries, so a restart of the SQL Server service is normally required after installing or repairing a provider.
Why does it work in one job but fail in another?
Different jobs can reference different providers or different bitness. Check the provider named in each failing job step.
Is SQL Server Native Client still recommended?
No. It is deprecated; use the current Microsoft OLE DB Driver for SQL Server or the vendor's supported provider.
Will reinstalling the provider break existing linked servers?
It should not, but record the linked server definitions first so you can restore them if needed.