Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When I connect to my local server, I get 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:   
Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft   
SQL Server, Error: 2)

This is my login information:

Server type :       Database Engine
Server name :       .
Authentication:     SQL Server Authentication
Login:              sa
Password:           123

How can I fix it?

share|improve this question
    
Is the SQL service started and in a running state? Also, are you connecting to a default or named instance? –  StanleyJohns Jul 30 '13 at 4:41
    
Are you able to connect to the server from any client? Can you connect directly from the server itself? If not, is the service in fact running? –  Ali Razeghi Jul 30 '13 at 4:42
    
@StanleyJohns .. Yes , SQL service started and is in a running state , I'm connecting to a default instance ! –  zey Jul 30 '13 at 4:43
    
@AliRazeghi , I can't connect directly from the server itself . I haven't connect from client yet ! –  zey Jul 30 '13 at 4:47
2  
Zey I was asking if you could RDP to the server and try to connect to SQL Server directly there. Normally this is horrible practice as it eats up RAM and so fourth, but for troubleshooting over a internet forum; it'll have to do. If you can, then you know services are running. Next thing to check is the fierwall and also ping. If it is NOT a named instance, you can TELNET <server IP> 1433. If the port was hardcoded or it is a named instance, then we have to find the port # first. If it opens to a blank screen your network is fine, if it doesn't, then something is blocking it in between. –  Ali Razeghi Jul 30 '13 at 4:55
show 1 more comment

2 Answers

up vote 3 down vote accepted

Go to SQL Server Configuration Manager

Start->all program->SQL Server 2008 R2->Configuration Tools->SQL Server Configuration Manager

Explore "SQL Server Network Configuration" and then select "Protocols For MSSQLSERVER".

Check your TCP/IP Protocols in right side pane. If it is disabled then enabled it and Restart the "Sql Server(MSSQLSERVER) service" that available in "SQL Server 2008 R2 services pane".

You can follow the same steps to make sure for other protocols and services.

share|improve this answer
add comment

Are you sure about your installation is successful?.If yes, then ckeck whether your server is

  1. configured for remote access

  2. exception in firewall

  3. check all protocols whether they are enabled or not accoding to your requirement.

  4. whether the instance is started or not.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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