0

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.


ADDITIONAL INFORMATION:

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?

3
  • 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? Commented Nov 11, 2011 at 1:23
  • Shared Memory / Named Pipes / TCP/IP are all enabled for Protocols for SQLEXPRESS. Commented Nov 11, 2011 at 13:13
  • I just enabled TCP/IP and restarted the service. It works! Commented Nov 11, 2011 at 13:15

2 Answers 2

4

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.

5
  • 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. Commented Nov 11, 2011 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. Commented Nov 11, 2011 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. Commented Nov 11, 2011 at 0:10
  • @Evik: No, they don't need to be running. Commented Nov 11, 2011 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. Commented Nov 11, 2011 at 13:16
1

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.

1
  • Yes, I now have named pipes enabled. It's still not working though. Commented Nov 11, 2011 at 0:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.