Can't connect to remote sql server: Named Pipes Provider, error: 40


  • I have recently installed SQL Server 2008 Express. I am attempting to connect to a remote sql server and I am receiving the following error:

    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: 123)

    I have already added the Microsoft SQL Server Management Studio to the Windows Firewall exception list.

    Please Help....



    Tuesday, January 20, 2009 2:56 PM

All replies

  • SQL Server Express has remote connections disabled by default, you will have to enable them through the server settings > Connections.

    -Jens K. Suessmeyer
    Tuesday, January 20, 2009 5:08 PM
  • Where do I find the Setting>Connections options in SQL Server 2008 Express? Is it in the SQL Server Management Studio application? I can't seem to find it.

    Tuesday, January 20, 2009 5:42 PM
  • Okay; I found the settings in the SQL Server Configuration Manager. I enabled all server network connection types, but I am still  having the same issue.

    BTW, I am able to connect to the particular database from my old computer, which has WinXP and SQL Server I am very confident about the IP Address, Username, and Password.

    Any other suggestions?


    Tuesday, January 20, 2009 8:49 PM
  • What are you putting in the Server box in Management Studio?  An IP address, in the format XXX.XXX.XXX.XXX, or a server name?  The Windows error code, 123, corresponds to:

    The filename, directory name, or volume label syntax is incorrect.

    I actually haven't seen anyone get that error code before, so I am completely shooting in the dark here... maybe the server name is something strange?  If you are specifying the server name, it could be helpful for us to see the server name.
    This post is provided 'as is' and confers no express or implied warranties or rights.
    Tuesday, January 20, 2009 11:08 PM
  • Right!  IN error Info-- (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 123),

    123 is Windows error code and it gives customer hints about why the connection fails.   You can try the IP address of the sql server you want to connect instead of server name, or check if your connnection string are correct in your code.

    Wednesday, January 21, 2009 6:01 PM
  • I have been using the IP address. I have been including the http:// in the IP address is this the correct format?

    Thursday, January 22, 2009 1:50 PM
  • Not is is simply the IPAdress.

    Jens K. Suessmeyer
    Friday, February 13, 2009 10:41 AM