I have SQL Server 2005 which is installed on server machine.

I was working fine on SQL server before I change the server machine IP. I changed server machine IP to host the Web Service on it.

But now when I enter the Login and Password information SQL Server displays this error 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)

I also tried to remove Server machine IP, Still I can't able to access the SQL Server. My all database stucked in it. Or can I recover my SQL server database?

3 Answers 3

  1. Make sure SQL Server Service is running
  2. If a named instance, make sure SQL Server browser service is running
  3. Make sure SQL Server is configured to allow remote connections
  4. Examine the SQL Server error log for messages confirming that SQL is listening on the expected network interfaces and ports
  5. Test server connectivity with PING from the client machine
  6. Test port connectivity using TELNET or PowerShell to the server and port (from step 4) from the client machine. For example

    a. TELNET 1433

    b. PowerShell:

1433 | % { echo ((new-object Net.Sockets.TcpClient).Connect("YourServerName",$_)) "server listening on TCP port $_" }

  1. Check firewall settings if step 5 or 6 connectivity test fails

For further read below forum discussing the same which would be helpful to you for troubleshooting :



If you do not suceeed in fixing your SQL Server instance, you can still move your databases to a newly installed SQL Server instance. Look for *.mdf and *.ldf files. Theese are database files that you can attach to a new SQL Server instance. Before copying those files make sure that your SQL Server service is stopped.

  • 2
    That you can attach... maybe. MDF/LDF files are not as reliable as proper backups. If the SQL Server service that can't be connected to is still running, you won't be able to move the files. And if it's running, they could be corrupt, depending on how SQL Server was brought down. Jan 29, 2015 at 15:37
  1. Enable the TCP/IP protocol using the Surface Area Configuration Utility
  2. Make sure the TCP/IP protocol is enabled in the SQL Server Configuration Utility
  3. Make sure the SQL Server browser is started. Note this step is optional. It is possible to set the SQL Server instance to use a fixed IP address - but this is non-standard for named instances
  4. Make sure SQL Server and SQL Server Browser are exempted by the firewall on the server machine. This is done by putting sqlservr.exe and sqlbrowser.exe as an exception in the windows firewall.
  5. Note: In order to get things to work. You might need to completely reboot the server machine after making the changes.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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