question

StanMatth-1227 avatar image
0 Votes"
StanMatth-1227 asked Cathyji-msft commented

Microsoft SQL Server connectivity issue from computer within network

I'm hosting an SQL server on a pc that runs ubuntu. I can connect using SSMS with a windows laptop through vpn which gives me a local ip like 10.0.8.0.
However a windows pc that is within the same subnet can't connect with the same credentials that i use with my laptop. The error i get is
"Named Pipes Provider, error: 40 - Could not open a connection to SQL Server" I've tried to specify the server instance and different connection methods.
I even tried to set up a second sql server outside my network and connecting with the troubled pc (also through vpn) ... and that somehow works.
So my question is: what is allowing connections with devices that are in the network through vpn and excluding devices that are in the same subnet?
Is my servername flat out wrong?
ive tried: the localip of the server (which works on vpn), the name of the server (which doesnt work anywhere), the localip and a server instance name...

sql-server-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is ""Named Pipes Provider, error: 40 - Could not open a connection to SQL Server" really the full error message? Usually it is longer.

0 Votes 0 ·

Hi @StanMatth-1227,

We have not received a response from you. Did the reply(s) could help you? If the response helped, do "Accept Answer". If it is not work, please let us know the progress. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·

1 Answer

Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered Cathyji-msft edited

Hi @StanMatth-1227,

This is a default SQL server instance or named instance? For SQL server named instance, we can using below connection string on server name box.

Server name\instance name
Ip, port number

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

Please follow below steps to troubleshot the issue,


  1. Make sure SQL Server Service is running

  2. If a named instance, make sure SQL Server browser service is running. Make sure the instance name is spelled correct and there is actually such an instance on your target machine.

  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 to the server and port (from step 4) from the client machine. For example
    TELNET <server-name> 1433

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


If you have some confuse about the steps, please refer to Resolving could not open a connection to SQL Server errors or Troubleshoot connecting to the SQL Server Database Engine to get more information.


If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.