-2

I had the following error message in Visual Studio when I am trying to connect to SQL Server:

I got 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: Shared Memory Provider, error: 40 - Could
>not open a connection to SQL Server)

This occurred when I was trying to setup SQL Management studio, but as always I face problems setting it up. Now I can't use either of them.

How do I fix this up?

Ahmed Moheb
  • 764
  • 1
  • 10
  • 20
  • Hm. Bad Pizza when programming. See, I program and I had a pizza that tasted terribly. Why? Same with your thing - the error CLEARLY points to "visual studio has ZERO relevance". Please spend more than 1 second thinking of a subject line. – TomTom Jan 06 '13 at 10:34
  • Yeah I think so – Ahmed Moheb Jun 23 '19 at 13:00

2 Answers2

2

Usually that means you either typed the server name incorrectly, or that the server does not have the SQL Server service running. Check those two things.

Joe Enos
  • 39,478
  • 11
  • 80
  • 136
2

This is a quite common issue. Take a look at existing answers on Stack Overflow, for example, How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?.

Community
  • 1
  • 1
Sebastian K
  • 6,235
  • 1
  • 43
  • 67