When I connect to my local server, I get this 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:   
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft   
SQL Server, Error: 2)

This is my login information:

  • Server type : Database Engine
  • Server name : .
  • Authentication: SQL Server Authentication
  • Login: sa
  • Password: ***

SQL Server service is started and is in a running state. I'm connecting to a default instance.

How can I fix it?

  • 2
    Zey I was asking if you could RDP to the server and try to connect to SQL Server directly there. Normally this is horrible practice as it eats up RAM and so forth, but for troubleshooting over a internet forum; it'll have to do. If you can, then you know services are running. Next thing to check is the firewall and also ping. If it is NOT a named instance, you can TELNET <server IP> 1433. If the port was hardcoded or it is a named instance, then we have to find the port # first. If it opens to a blank screen your network is fine, if it doesn't, then something is blocking it in between. Commented Jul 30, 2013 at 4:55

3 Answers 3


Go to SQL Server Configuration Manager

Start->all program->SQL Server 2008 R2->Configuration Tools->SQL Server Configuration Manager

Explore "SQL Server Network Configuration" and then select "Protocols For MSSQLSERVER".

Check your TCP/IP Protocols in right side pane. If it is disabled then enabled it and Restart the "Sql Server(MSSQLSERVER) service" that available in "SQL Server 2008 R2 services pane".

You can follow the same steps to make sure for other protocols and services.


Are you sure about your installation is successful?.If yes, then ckeck whether your server is

  1. configured for remote access

  2. exception in firewall

  3. check all protocols whether they are enabled or not accoding to your requirement.

  4. whether the instance is started or not.


Click on Start-> Search for "services.msc" hit Enter. Now you will see all the services which are running on your Computer.

Start the service : 1. SQL Server (MSSQLSERVER)

Then connect to local by providing server name : (local)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.