0

I installed SQL Server 2008 (not express) on my PC, but when tried to connect with SSMS, got this message:

A network-related or instance specific error occured while established 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) (Misrosoft SQL Server, Error 2)

My connection dialog box to SSMS is:

Server type: Database Engine.
Server name: (local)
Authentication:  Windows 

What should I check? Where to start troubleshooting?

James Z
  • 12,209
  • 10
  • 24
  • 44
kumbhani bhavesh
  • 2,189
  • 1
  • 15
  • 26
  • 1
    Possible duplicate of [Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"?](http://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci) – Bridge May 27 '16 at 11:03

4 Answers4

1
GO TO >> Run Command (Ctrl + r ) 

Type -- services.msc

go to SQL SERVER >> Right Click >> Click Start 

Again Restart SQL SERVER Studio
mohan111
  • 8,633
  • 4
  • 28
  • 55
  • http://stackoverflow.com/questions/20798032/provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server – mohan111 May 27 '16 at 11:04
  • How do you know the service is stopped? Isn't there any other reason why local connection could not be achieved? – BytesOfMetal May 27 '16 at 11:08
  • I have faced this issue several times when my Sql server unable to open ..this is the process to start my Sql Studio again – mohan111 May 27 '16 at 11:11
0

Here are some troubleshooting tips that you can do:

  • Try to run your SSMS as admin
  • Make sure that you are using the correct server name and instance
  • Check if your sql server service is running by going to run -> services.msc -> Check SQL Server(Instance Name) service if it is running
Bon Macalindong
  • 1,310
  • 13
  • 20
0

Error 40 has many reasons, some of them are related to network configurations which are out of scope in your question. Other reasons which may cause this error and has possibility in your question are as follow:

  1. Make sure that SQL SERVER(XXX) service is running by visiting sql server configuration manager section
  2. Make sure that SQL Browser service is running by visiting sql server configuration manager section
  3. Make sure you are using the correct instance name

Read more about this error

Vahid Farahmandian
  • 6,081
  • 7
  • 42
  • 62
0

If your server is Local. Try to login with server name . or (local).

If you are still not able to login, check Check SQL Server Configuration Manager (Start>All Programs>MS SQL Server>Configuration Tools>Configuration Manager)

p2k
  • 2,126
  • 4
  • 23
  • 39