Friday, August 1, 2008

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

Are you getting the following message when you try connecting to SQLSever 2005 on some other machine ?

TITLE: Microsoft SQL Server Management Studio------------------------------
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1396)

This mainly happens if you haven't allowed remote connections on the sqlserver.

  • Go to MicrosoftSQLServer2005> ConfigurationTools>SQL Server Surface AreaConfiguration tool
  • Click on Surface Area Configuration for services and Connections
  • Select MSSQLServer
  • Select Remote Connections option
  • If you are using SQL Server Developed Edition, by default Local Connections only is selected.
    Select Local and remote connections and select the first option Using TCP/IP only if you are not using Named pipes.
  • Restart MSSQLServer services.
  • At times, it's better to reboot the system to make the change effective.

 
Google