In this article, we will be discussing about a popular error message, that is: “A network-related or instance-specific error occurred while establishing a connection to SQL Server”
About the network-related or instance-specific error
Under certain circumstances, there are cases where you might try to connect to a SQL Server instance and get the error message: “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) (Microsoft SQL Server, Error: -1)”
This is the standard error message you get when your client does not “see” the SQL Server instance you are trying to connect to. However, there is more than one possible reasons for getting this message.
Possible Reasons for the network-related or instance-specific error
Here’s a list of possible reasons:
- [Reason 1] You may have misspelled the instance name or IP 🙂
- How to further investigate:
From the client, try to ping the network name for the SQL Server instance and see if you get a response.- If it is a default instance (i.e. SQLInstance1.contoso.local) then ping “SQLInstance1.contoso.local”
- If it is a named instance (i.e. VirtualName1.contoso.local\SQLInstance1) then ping “VirtualName1.contoso.local”
> If ping does not reply, make sure that you are using the correct network name.
> If you still cannot connect to SQL Server, proceed and check the rest of possible reasons.
- How to further investigate:
- [Reason 2] If the SQL Server instance is located on a different domain than your client, you may have not included the fully qualified domain name (FQDN) in the SQL Server instance name (i.e. SQLInstance1 vs SQLInstance1.contoso.local) – this assumes that the two domains are trusted between them
- How to further investigate:
Again, just like the actions in possible reason 1, try to ping the instance name from the client using the instance’s FQDN.
> If you still cannot connect to SQL Server, proceed and check the rest of possible reasons.
- How to further investigate:
- [Reason 3] If there is a firewall in your network, you might not be allowed to access the SQL Server instance through the network.
- How to further investigate:
If you know for example that you want to connect to the SQL Server instance “SQLInstance1.contoso.local” on port 52500, then you can try from a command prompt on the client, to run the command: telnet SQLInstance1.contoso.local 52500
If the above telnet command reports that “Could not open connection to the host, on port 52500: Connect failed” (or something similar), it means that there is no network communication between the client and the SQL Server instance at the designated port number. In this case, you should report it to your Network administrator.
- How to further investigate:
- [Reason 4] If you are trying to connect to a named instance, make sure that the SQL Server Browser service is running.
- How to further investigate:
Remotely connect on the SQL Server machine (or via remote administration) and check that the “SQL Server Browser” service is up and running.
- How to further investigate:
- [Reason 5] Make sure that your SQL Server instance allows remote connections.
- How to further investigate:
Connect remotely on the SQL Server machine, and log in to SQL Server Database Engine via SQL Server Management Studio. Then, right-click on the instance name, select “Properties” and check the “Connections” tab to see if the SQL Server instance allows remote connections. See the below screenshot for example.
- How to further investigate:
Hopefully if you go through the above, you will finally manage to successfully connect to your SQL Server instance.
Strengthen your SQL Server Administration Skills – Enroll to our Online Course!
Check our online course on Udemy titled “Essential SQL Server Administration Tips” (special limited-time discount included in link).
Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!
Featured Online Courses:
- Boost SQL Server Database Performance with In-Memory OLTP
- Essential SQL Server Administration Tips
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Development Tips for SQL Developers
- The Philosophy and Fundamentals of Computer Programming
- .NET Programming for Beginners – Windows Forms with C#
- Introduction to SQL Server Machine Learning Services
- Introduction to Azure SQL Database for Beginners
- SQL Server 2019: What’s New – New and Enhanced Features
- Entity Framework: Getting Started – Complete Beginners Guide
- How to Import and Export Data in SQL Server Databases
- Learn How to Install and Start Using SQL Server in 30 Mins
- A Guide on How to Start and Monetize a Successful Blog
Related Error Messages and ways to Resolve them:
- Operating System Error 170 (Requested Resource is in use)
- There is no SQL Server Failover Cluster Available to Join
- Setup failed to start on the remote machine. Check the Task scheduler event log on the remote machine.
- SQL Server 2008 R2 Service Pack Installation Fails – Element not found. (Exception from HRESULT: 0x80070490)
- Could not load file or assembly ‘Microsoft.SqlServer.Smo, Version=10.0.0.0, …
- The operation failed because either the specified cluster node is not the owner of the group, or the node is not a possible owner of the group
- There is not enough space on the disk. (mscorlib)
- The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value
- … more SQL Server troubleshooting articles
Check out our latest software releases!
Subscribe to our newsletter and stay up to date!
Easily generate snippets with Snippets Generator!
Secure your databases using DBA Security Advisor!
Convert static T-SQL to dynamic and vice versa with Dynamic SQL Generator.
Rate this article:
Reference: SQLNetHub.com (https://www.sqlnethub.com)
© 2018 SQLNetHub
Artemakis Artemiou, a distinguished Senior Database and Software Architect, brings over 20 years of expertise to the IT industry. A Certified Database, Cloud, and AI professional, he earned the Microsoft Data Platform MVP title for nine consecutive years (2009-2018). As the founder of SQLNetHub and GnoelixiAI Hub, Artemakis is dedicated to sharing his knowledge and democratizing education on various fields such as: Databases, Cloud, AI, and Software Development. His commitment to simplicity and knowledge sharing defines his impactful presence in the tech community.