I found out that when I connect to a remote SQL named instance (ServerA\instanceA) from SSMS installed on ServerB, it does connect without error, but it uses the Named Pipe protocol.

I found that out when I noticed that the SQL named instance port (50002) was blocked by the Firewall.

From SSMS (on serverB), I get an error when I try to connect to ServerA,50002 but it succeeded when I connect to ServerA\InstanceA.

I googled it, but wasn't able to find any good documentation explaining why it works.

I checked and I didn't see any alias or any particular configuration for ServerA.

If you could help me understand how (and why) it works, I would appreciate.

  • Is the named instance the only instance installed on that server?
    – J.D.
    Oct 27, 2022 at 18:45

1 Answer 1


Although the named instance TCP port 50002 was blocked, port 445 is used for named pipes (SMB) and is apparently allowed by the firewall.

The SqlClient driver tries TCP/IP first and then falls back and attempts named pipes when the TCP connection fails. This is called out in the Client Protocols Properties doc page. That's why one often sees a reference to named pipes in the error message when a connection fails.

IIRC, older drivers tried named pipes first and TCP/IP only when that failed.

Your Answer

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

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