Static port allocation
However, if an instance of SQL Server is configured to listen on a static port, and another program that is running on the computer is already using the specified static port when SQL Server is started, SQL Server does not listen on the specified static port.
By default, the default instance of SQL Server listens for requests from SQL Server clients on static port 1433. Therefore, the client network libraries assume that either port 1433 or the global default port that is defined for that client computer is used to connect to the default instance of SQL Server.
If a default instance of SQL Server is listening on a port other than port 1433, you must either define a server alias name or change the global default port by using the Client Network Utility. However, you can also make the default instance of SQL Server listen on multiple static ports.
Dynamic port allocation
The allocated port number is written to the Windows registry. Every time that you start that named instance of SQL Server, it uses that allocated port number. However, in the unlikely case that another program that is already running on the computer is using that previously allocated (but not static) port number when you start SQL Server, SQL Server chooses another port.
Verifying the port configuration of an instance of SQL Server
NoteDefault instances of SQL Server always use a static port.
First verify that your instance of SQL Server has the TCP/IP protocol enabled. Then, to find which TCP/IP port your instance of SQL Server is "listening on", examine the SQL Server error log. Additionally, in SQL Server 2005 and in later versions, you can check settings in the SQL Server Configuration Manager. If you wish to see the SQL error log from within a program, follow these steps.
Note For SQL Server 2000, use Query analyzer to execute the following queries.
1. Start SQL Server Management Studio, and then connect to the instance of SQL Server.
2. Run the following query:
3. Use master Go Xp_readerrorlog
4. In the Results pane, locate the following text (where X.X.X.X is the IP address of the instance of SQL Server and Y is the TCP/IP port where SQL Server is listening):
SQL server listening on X.X.X.X: Y
Note: For example, if you locate the "SQL server listening on 10.150.158.246: 1433" text in the Results pane, 10.150.158.246 is the IP address of the SQL Server and 1433 is the TCP/IP port where the instance of SQL Server is listening.
To verify the port configuration of an instance of SQL Server, follow these steps:
1. Start Registry Editor.
2. In Registry Editor, locate the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceName>\MSSQLServer\SuperSocketNetLib\Tcp
Note If you are using SQL Server 2005, locate the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<MSSQL.x>\MSSQLServer\SuperSocketNetLib\Tcp\IPAll
Notice the TCPDynamicPorts value and the TCPPort value. These values appear as follows, depending on your port allocation method:
o Static Port Allocation
If you configure an instance of SQL Server to use a static port, and you have not yet restarted the instance of SQL Server, the registry values are set as follows:
TCPDynamicPorts = Last port used
TCPPort = New static port to be used after the next restart; new static port that you set by using the Server Network Utility
However, if you configure an instance of SQL Server to use a static port, and you restart the instance of SQL Server, the registry values are set as follows:
TCPDynamicPorts = Blank
TCPPort = New static port that you set by using the Server Network Utility
o Dynamic Port Allocation
If you configure an instance of SQL Server to use dynamic port allocation, and you have not yet restarted the instance of SQL Server, the registry values are set as follows:
TCPDynamicPorts = Blank
TCPPort = 0
However, if you configure an instance of SQL Server to use dynamic port allocation, and you restart the instance of SQL Server, the registry values are set as follows:
TCPDynamicPorts = Current port used
TCPPort = Current port used
Configuring an instance of SQL Server to use a static port
SQL Server 2005 and SQL Server 2008
To configure an instance of SQL Server 2005 or SQL Server 2008 to use a static port, follow the steps that are described in the How to: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager) topic in SQL Server 2005 Books Online or in SQL Server 2008 Books Online.
To configure a static port for the specialized Dedicated Administrator Connection (DAC), you must update the registry key that corresponds to your instance. For example, the registry key may be the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.X\MSSQLServer\SuperSocketNetLib\AdminConnection\Tcp
Note The "X" in "MSSQL.X" is a number that indicates the directory where the instance is installed for SQL Server 2005 or the instance name for SQL Server 2008.
SQL Server 2000
To configure an instance of SQL Server to use a static port, follow these steps:
1. Start the Server Network Utility. To do this, do one of the following:
o Click Start, point to Programs, point to Microsoft SQL Server, and then click Server Network Utility.

Join the conversation! Your thoughts help the community grow.