While trying to establish a connection to SQL Server via the Microsoft SQL Server Management Studio, you can get this error:
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)
The network-related or instance-specific error can be caused by a few things. Here are a few troubleshooting steps for fixing errors that occur while establishing a connection to SQL Server:
- Check network connectivity. Can you ping the SQL Server (assuming the firewall allows IMCP Echos)? Can you establish a telenet connection to the SQL server on port 1433 (or whatever you set the port to be, 1433 is the default SQL port for single instance installations of SQL)? Does DNS resolve properly? Is there a rule in the Windows Firewall to allow SQL connections?
- Have you enabled remote connections to SQL Server?
- Is SQL Server running? Have you checked the SQL Server services?
- Are there any errors in the event viewer on the SQL server you are trying to establish a connection to?