Fail to connect to server I am getting this error when attempting to connect to a SQL Server 2008 R2 machine:


  Cannot connect to JUPITER. 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: 53)


After restarting the service on server, everything works fine.

Why does this problem arise? How to solve this issue? 

Thanks in advance
Is this a named instance? If so, you need to ensure that the SQL Server Browser service is started. If it is not, you will not be able to connect.

Also, can you ping this server remotely? How about telnet to port 1433 (default port for the default instance)?

Check your SQL Server error log to see if there is any unusual activity and errors.

That's a start to troubleshooting this problem.