I am trying to set up SQL Server 2008 R2 on my local machine for development. I set it up as well as SQL Server 2008 R2 Management Studio. When I open studio to connect to the database engine, I get this error (MONSTER is the name of my local machine):

TITLE: Connect to Server

Cannot connect to MONSTER.


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)

Here are the params I have

Server type: database engine
Server name: MONSTER
Authentication: Windows Authentication

Can you help?

  • Have you used SQL Server Configuration Manager to see which protocols are enabled for this instance of SQL? Also, have you verified that the SQL Server service is running? – joeqwerty Nov 11 '11 at 1:23
  • Shared Memory / Named Pipes / TCP/IP are all enabled for Protocols for SQLEXPRESS. – Evik James Nov 11 '11 at 13:13
  • I just enabled TCP/IP and restarted the service. It works! – Evik James Nov 11 '11 at 13:15

You have to enable Named Pipes for SQL Management Studio to be able to connect, even on the local box. Start->All Programs->Microsoft SQL Server 2008 R2->Configuration Tools->SQL Configuration Manager. Look at SQL Server Network Configuration->Protocols for [instance name]. Enable Named pipes and restart the SQL Server Service.

Edit: SQL Management Studio uses the Visual Studio shell just in case you wondered why I'm talking about Management Studio instead of Visual Studio.

  • I did exactly as you said. I REALLY appreciate your thorough and accurate response. I have named pipes enabled for "Protocols for SQLEXPRESS". I restarted the services. I am getting the exact same error though. – Evik James Nov 11 '11 at 0:06
  • Really? I thought SSMS connecting to a local instance used Shared Memory, not the network protocols or at the very least would fallback to Shared Memory if network connectivity failed. Shared Memory connections are enabled by default, unlike network protocols. – joeqwerty Nov 11 '11 at 0:07
  • Should the SQL Server Agent and Browser services be running? They were not running, but I got Browser started. Agent will not start though. – Evik James Nov 11 '11 at 0:10
  • @Evik: No, they don't need to be running. – joeqwerty Nov 11 '11 at 1:21
  • Thanks for your help. I'm sure I'll be back in three years when I install SQL Server 2015 on my next local box. – Evik James Nov 11 '11 at 13:16

Have you enabled Named Pipes in the configuration manager like the error message is telling you to? That seems like the most obvious course of action to me.

  • Yes, I now have named pipes enabled. It's still not working though. – Evik James Nov 11 '11 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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