Introduction: Here I will explain how to solve the problem “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)” during the time of connect to database.

Description:

Today I opened SQL Server Management Studio in my laptop to connect to database unexpectedly I got error like “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)”. I didn’t get why this happened because previously it worked perfectly. To solve this problem I did some research and found solution at that time I decided to write post to help someone who is in need with this problem. Check below methods to solve this problem.

First Method

Open SQL Server Management Studio now Connect window will open check whether you given proper Server Type and Server Name or not because if we give incorrect details then we have a chance to get this issue.

4.Now select SQL Server Network Configuration >> Select Protocols for MSSQLSERVER >> TCP/IP and check status of TCP/IP whether is it enabled or not if that TCP/IP state is in Disabled state right click on it and Enable that one.

Now restart your SQL Server Management Studio and check it I hope it will work for you.

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) SQL server 2005