Sql – port number of SQL Server

sqlsql-server-2008

I am wondering what ports are used by SQL Server database engine? I need such port number to write configuration scripts to grant access to specific port of the machine installed with SQL Server to make it safe. A related question is whether SQL Server database engine will use one static port number to serve all client requests, or using one port for each request?

BTW: my background is SQL Server 2008 enterprise.

thanks in advance,
George

Best Answer

The default instance uses port 1433. Named instances will use dynamically negotiated ports (but can be configured to listen on specified ports-- see http://msdn.microsoft.com/en-us/library/ms177440.aspx).

Edit:

By default when a named instance of SQL Server starts it chooses a randomly unused port and registers that with the SQL Browser service. Clients send requests to that service (UDP port 1434) to retrive the port number for the instance they're trying to connect. You are correct in that the dynamic port number will remain the same throughout a single execution of a given instance. If you stop / restart that instance, though, the port number will change. So, there is no "fixed" value for the dynamic port.

Related Topic