The port to which to connect can be overridden using a FreeTDS™ extended syntax.
A port may be appended to the servername in the form
. FreeTDS™ will attempt to connect to specified port. Please note servername
:port
port
must be a number; a service name is not supported.
If you specify
as servername during login, FreeTDS™ will attempt to connect to specified instance.
Only Microsoft SQL Server instances are supported. (This server feature was introduced with Microsoft SQL Server 2000.)servername
\instance
Note that other freetds.conf
properties still apply.
For the technically curious: each Microsoft SQL Server instance appears on the network as a server listening at a port.
The old way — and it still works — is to designate each instance in freetds.conf
as a separate server.
The new “named instance” notation, if we can call it that, instead uses the server to discover the port.
The library sends a UDP packet containing the instance name to the server at a well known port, port 1434.
The server responds with a port number.
FreeTDS™ then uses that number to connect in the usual way.