Sometimes you may see “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified” error message when connecting to a SQL Server and don’t know where to start. In most forums people say this is because remote connection is not enabled on the server. This is not exactly correct. Actually, this error message gives customers a very specific information and the solution is quite simple.
First of all, you get this error message only if you are trying to connect to a SQL Server named instance. For a default instance you never see this. Why? Because even if we have failed at this stage (i.e. error locating server/instance specified), we will continue to try connect using default values, e.g default TCP port 1433, default pipe name for Named Pipes. You may see others error messages due to failure later, but not this error message.
Every time client makes a connection to SQL Server named instance, we will send a SSRP UDP packet to the server machine UDP port 1434. We need this step to know configuration information of the SQL instance, e.g., protocols enabled, TCP port, pipe name etc. Without this information, a client does know how to connect to the server and it fails with this specific error message.
In other wors, the reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It’s easy to resolve the issue. Here are the steps:
- Make sure your server name is correct, e.g., no typo on the name.
- Make sure your instance name is correct and there is actually such an instance on your target machine. (Try to use a connection string like .\<instance-name> to connect to an instance on your local computer. E.g: .\SQLEXPRESS)
- When you try to connect to an SQL Server instance on another server, make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
- Make sure SQL Browser service is running on the server.
- If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
Once you are done with these steps, you should not see this error message anymore.
21 thoughts on “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified”
Very useful info. I was having trouble figuring out why I could connect using named pipes from SQLCMD but not from SSMS and this answered that.
Thanks for the suggestions it is working
Helped to fix the issue with the named pipes. Thanks much!!!
hello friends i am face a big problem with the visual stdio 10 .
when i try to add a sql database in my web site then a error 26 message show on the screen.
thank a lot it help me very much
Thanks a lot for this note
“Make sure SQL Browser service is running on the server. ”
None of the available solutions on the internet referred to it
Thanks a lot for this info
Hi, I get this message in a very weird way.
Users Login in App and see pages and data that is come from database.but as it is needed to check Users Role I see this error.
i check users role by [AuthLog(Roles = “admin”)]
Text xml:lang=”en-US”>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)
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)
Thank you so much. Step 4 helped me resolve the issue.
You are the BEST!
I had the same issue then I used the connection string without ./ (like DESKTOP-E53DUML instead of this ./DESKTOP-E53DUML)
Click on Start Windows. Type “Services” and search for SQL Server(UserName) like “SQL Server(PARAG)” and right-click on it and start the services. Your problem gets solved.
This worked for me
Sadly that’s not the case in our situation. We have one computer that gets this error, but the rest of us doesn’t have a problem, so it seems to be something with the person’s computer but we have no idea what, as it worked before. We’ve tried the PortQryUI tool from microsoft on the specified computer and it shows the same results as on mine, it shows the server is listening on that port.
I continue to get this error on SQL 2016 local instance running IIS web application connecting to the local instance of SQL server.
Here is where it gets weird I can connect the first time login to the app and hit the database but any time I click on a hyperlink to another page in the application is when I get the error.
Same connection string as the original is being used.
Connection string is good because it wouldn’t have connected in the first place if it was not.
Firewall exception is good no issues with traffic
Browser service is running
Problem only happens when another page is loaded after first page loads fine and hits the database without issue.
Exactly what I am facing now. It works for the first time but when I restart the application, it starts throwing this error and as Nadia commented, the error throws at line “Roles.IsUserInRole(“Admin”)” in Home.cshtml. I have to restart my system to run my application again but this error still persists. Can’t figure out the exact issue yet.
Did you ever get a fix for this.. I seem to be having this issue now.
Thank you very much, Steps 4 and 5 and restart of main and second instance and browser helped me resolve this !
When I connect to SQL Server, the following error message found by sql server management studio
TITLE: Connect to Server
Cannot connect to server_name.
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: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 26) how to fixed this problem