2

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.

Dominique Boucher
  • 3,287
  • 11
  • 27

1 Answers1

4

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.

Dan Guzman
  • 28,989
  • 2
  • 46
  • 71