Error Locating Server/Instance Specified (Error 26)

🚨Part of the SQL Server Errors series, the exact messages and what actually causes them.Related pillar: Server & Configuration

You connected to a named instance, something like SQLPROD01\SALES, and the client could not find out which port it listens on. Nothing reached SQL Server, so nothing was logged. Check the instance name, then the Browser service, then UDP 1434, or skip all three by putting the port in the server name.

Error 26  ·  SQL Network Interfaces
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

That is the System.Data.SqlClient text, also listed on the network-related error page on MS Docs. sqlcmd and ODBC show the same fault as Error Locating Server/Instance Specified [xFFFFFFFF].

⚡Error 26 means the named instance’s port could not be looked up. Check the instance name, then the Browser service, then UDP 1434. Need it working now? Connect with the port.

What the Client Was Trying to Do

A named instance has no port in its name. Before it can connect, the client sends a UDP message to port 1434 on the server, and the SQL Server Browser service answers with the instance’s TCP port, as the SQL Server Browser service page on MS Docs describes. No answer, or no instance by that name, and the client gives up with error 26 when the login timeout runs out. The default instance on the same machine still connects, because it does not need the Browser.

sqlcmd to HPAI01\NOPE, a named instance that does not exist: Error Locating Server/Instance Specified [xFFFFFFFF], Login timeout expired, then the network-related or instance-specific error

Check the Instance Name

A typo gets exactly the same error 26 as a stopped Browser, so rule it out first. On the server, the service name carries the instance name: MSSQL$SALES is the instance SALES, and MSSQLSERVER is the default instance, which you connect to with the machine name alone.

Get-Service MSSQL*

If the name is right, MS Docs lists one more server-side cause: the instance is hidden, so the Browser does not announce it. Clients then need the port.


Check the Browser Service Is Running

On the server:

Get-Service SQLBrowser | Format-Table Status, StartType, Name -AutoSize
Get-Service SQLBrowser showing Status Stopped and StartType Disabled

Stopped means no named instance on that machine can be found by name. Set it to Automatic and start it in SQL Server Configuration Manager. Some estates leave it off on purpose: the MS Docs firewall page recommends keeping the Browser stopped and connecting with the port number for the most secure setup. If that is your standard, the fix is the port, not the service.


Check UDP 1434 Is Open

The Browser can be running and still unreachable. The lookup is UDP, so a firewall rule for TCP 1434 does nothing, and Test-NetConnection cannot check it because it only tests TCP. Open UDP 1434 inbound on the server, plus the instance’s TCP port, as the firewall page sets out. To test UDP 1434 from the client, MS Docs uses PortQry.


Skip the Browser With the Port

Put the port after the server name and the client never asks the Browser:

sqlcmd -S "tcp:SQLPROD01,50123" -E -C -W -Q "SELECT @@SERVERNAME AS server_name, CONNECTIONPROPERTY('net_transport') AS net_transport, CONNECTIONPROPERTY('local_tcp_port') AS local_tcp_port"
sqlcmd with tcp:HPAI01,1433 connects with the Browser stopped: server_name HPAI01, net_transport TCP, local_tcp_port 1433

If the port works and the name does not, the Browser or UDP 1434 is the problem, the same test MS Docs gives. Two things to know before you hard-code it:

  • The instance name is ignored once a port is given. On the lab, HPAI01\NOPE,1433 connected to the default instance, and there is no instance called NOPE. Check @@SERVERNAME on the connection.
  • Named instances use dynamic ports by default, and a dynamic port can change on restart (MS Docs). Set a static port first; SQL Server Default Ports covers it.

Frequently Asked Questions

The default instance connects but the named instance does not.
The default instance listens on a known port, usually 1433, so the client goes straight there. Only the named instance needs the Browser on UDP 1434. That split is the signature of error 26: check the Browser and UDP 1434.
The Browser is running and UDP 1434 is open. Why do I still get 26?
Check the instance name character by character, and check the client is asking the server you think: an alias in SQL Server Configuration Manager can send a good name to another machine. A hidden instance also gives 26. Connecting with the port settles which side is wrong.
Why does it take so long to fail?
The client waits for a Browser reply that never comes, then reports the error when the login timeout expires. On the lab sqlcmd gave up after 8 seconds, its default login timeout (-l); System.Data.SqlClient waits 15 seconds by default.
Is there anything in the SQL Server error log?
No. The attempt never reached SQL Server. The evidence is the message on the client, and the Browser service state and firewall rules on the server.

Where To Go Next

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *