Skip to content
Microsoft SQL Server

SQL Server Error 7399

The OLE DB provider for linked server reported an error

Severity 16 Linked Servers
Applies to: All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance (supported providers only)
Last technically reviewed 23 October 2026 on SQL Server 2025 (17.0.1145.4)
The full message
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01" reported an error. Authentication failed.
Other forms of this message
Followed by (in the same test)
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01".
OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01" returned message "Invalid authorization specification".
Older wording with a remote login timeout (from Microsoft documentation)
Server: Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'SQLOLEDB' reported an error. [OLE/DB provider returned message: Timeout expired] OLE DB error trace [OLE/DB Provider 'SQLOLEDB' IDBInitialize::Initialize returned 0x80004005: ].
Error number
7399
Severity
16 (user-correctable error)
State
1
Product
Microsoft SQL Server Database Engine
Versions
All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance (supported providers only)
Last reviewed
23 October 2026

What it means

Error 7399 is a generic wrapper: the OLE DB provider behind a linked server failed and passed its own short reason, which is the part of the message after "reported an error."

SQL Server does not know why the provider failed; it relays what the provider said. So the useful part of 7399 is the text after reported an error., for example Authentication failed., Access denied. or a timeout, plus any returned message lines and the error that follows (often 7303 when the connect step failed, or 7350 and 7321 when a query step failed). Read all of them together before changing anything.

The quoted provider name tells you which driver was used (for example MSOLEDBSQL19 for the SQL Server OLE DB driver, Microsoft.ACE.OLEDB.16.0 for Access and Excel files) and the second name is the linked server. Microsoft notes that the most common reason inside 7399 is a timeout: logging in to the remote server or running the remote query took longer than the configured limit.

Common causes

  • The login mapping sends no usable credentials or wrong ones (reason Authentication failed., often with Invalid authorization specification).
  • Windows credentials cannot be passed on (the double hop): the user connects with Windows authentication and the linked server uses self-mapping without Kerberos delegation.
  • The remote server took too long to accept the login or to run the remote query (the timeout forms described by Microsoft).
  • A file based provider (Access or Excel) cannot read the file as the SQL Server service account, or the provider gave no detail at all.
  • A problem on the remote side, such as the remote database being offline or the remote query failing.

Diagnose it

Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.

Which provider and data source does the linked server use?

SELECT name, provider, data_source, provider_string, catalog,
       connect_timeout, query_timeout, is_remote_login_enabled
FROM sys.servers
WHERE is_linked = 1;
What to look for

Match the provider and linked server names in the message. connect_timeout and query_timeout of 0 mean the server-wide defaults apply.

How are local logins mapped?

SELECT s.name AS linked_server, p.name AS local_login, l.uses_self_credential, l.remote_name
FROM sys.linked_logins AS l
JOIN sys.servers AS s ON s.server_id = l.server_id
LEFT JOIN sys.server_principals AS p ON p.principal_id = l.local_principal_id
WHERE s.is_linked = 1;
What to look for

For Authentication failed, look for a mapping with uses_self_credential = 0 and no remote_name, or a self-mapping used by Windows logins (which needs Kerberos delegation).

Is my connection using Kerberos?

SELECT session_id, auth_scheme, net_transport, client_net_address
FROM sys.dm_exec_connections
WHERE session_id = @@SPID;
What to look for

NTLM here while the linked server uses self-mapping means your Windows credentials cannot be forwarded to the remote server; you need KERBEROS and delegation, or a SQL login mapping.

What are the server-wide remote timeouts?

SELECT name, value_in_use
FROM sys.configurations
WHERE name IN (N'remote login timeout (s)', N'remote query timeout (s)');
What to look for

The limits used when the linked server has no timeout of its own. Compare them with how long the failing query ran before it stopped.

How to fix it

Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.

Fix the login mapping

Changes permissions

Map the local logins that use the linked server either to themselves (with Kerberos delegation configured for Windows logins) or to a dedicated remote login that has only the permissions the queries need. Then test with sp_testlinkedserver.

Caution: Never map all local logins to sa or another sysadmin login on the remote server: every user of the linked server would get full control there.

EXEC master.dbo.sp_addlinkedsrvlogin
     @rmtsrvname = N'SALESSRV01', @useself = N'False',
     @locallogin = N'CONTOSO\ReportUser',
     @rmtuser = N'report_reader', @rmtpassword = N'<strong password>';

EXEC master.dbo.sp_testlinkedserver N'SALESSRV01';

Set a timeout on the linked server, not the whole instance

Changes configuration

If the reason is a timeout, first find out why the remote login or query is slow. If a longer limit is genuinely needed, set it for this linked server only with sp_serveroption, which leaves other linked servers unchanged.

EXEC master.dbo.sp_serveroption
     @server = N'SALESSRV01', @optname = N'query timeout', @optvalue = N'1200';

Make remote queries do less

Client or network side

Use OPENQUERY or EXEC ... AT so filtering and joins run on the remote server and only the rows you need cross the network, instead of pulling whole remote tables through four-part names.

Examples

A login mapping with no remote credentials

Reproduced on SQL Server 2025 (17.0.1145.4) with a temporary linked server (MSOLEDBSQL provider) whose only login mapping had @useself = 'False' and no remote user; it was dropped afterwards and the name is changed here. The provider refused before any login reached the remote server.

-- Linked server SALESSRV01 (provider MSOLEDBSQL), mapped with:
-- EXEC sp_addlinkedsrvlogin N'SALESSRV01', N'False', NULL, NULL, NULL;
SELECT * FROM OPENQUERY(SALESSRV01, 'SELECT 1 AS x');
Result
Msg 7399, Level 16, State 1, Line 3
The OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01" reported an error. Authentication failed.
Msg 7303, Level 16, State 1, Line 3
Cannot initialize the data source object of OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01".
OLE DB provider "MSOLEDBSQL19" for linked server "SALESSRV01" returned message "Invalid authorization specification".

How to prevent it

Define every linked server with an explicit, least-privilege login mapping, and decide up front whether it relies on Kerberos delegation or on a dedicated remote login. Keep these definitions in your server build scripts and test them with sp_testlinkedserver after service account, driver or password changes.

Keep remote queries small and filtered on the remote side, so they finish well within the remote query timeout.

Common questions

Should I raise the remote query timeout with sp_configure?

Not as a first step. A server-wide change affects every linked server. Find out why the remote call is slow, and if one linked server really needs more time, set its own query timeout with sp_serveroption.

Why does the linked server work for me but fail for other users?

Each local login can have its own mapping. Yours may use your own credentials over Kerberos, while others fall back to a default mapping with no credentials or connect with NTLM, which cannot be forwarded. Compare the rows in sys.linked_logins.

Will the remote access server option fix 7399?

No. That option controls remote stored procedure calls from old-style remote servers. It has nothing to do with linked server login mappings or provider errors.

Learn more on CodeWithSQL

Official documentation

Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.

Still stuck on a SQL Server error?

Browse the full SQL Server error library, or get hands-on help from an experienced SQL professional.