SQL Server TCP/IP Static and Dynamic Ports

SQL Server TCP/IP Static and Dynamic Ports must be configured/known by a DBA.

If Windows Firewall is active in a environment then all the ports closed except the ones which are given exceptions.
In some environments only the inbound connections are restricted,the outbound connections are not.
Exceptions to Firewall can either be given per Binaries or by Port.

To avoid connectivity issues with SQL Server, DBA should configure the Ports to Static where possible.
When a new SQL Server instance is installed if its Default instance then its given static port 1433.
But if the SQL Server instance is a named instance then it will give a Dynamic port to the SQL Server which may change when SQL Services are restarted.

In a Environment with Firewall active one should change the Dynamic Port for SQL Server to Static Port. After changing this exceptions can be added to Firewall to allow connections to SQL Server.

To check the SQL Server Ports Go To- SQL Configuration manager->Protocols for [InstanceName]->TCP/IP -> Properties.

Now scroll down to very last bit and see if a value other than “Zero” is given in Dynamics Ports section then your server is configured with Dynamic Port.
If you like to change this Static then change the Dynamic Ports value to “Zero”. Chose a port for Static port just below Dynamic port. Normally ports above 50000 are advised.

Any change of Ports/Properties on SQL Server Services needs a Restart of Services.
The Port SQL Server is listening On can also be checked in Errorlog of SQL Server as shown below:

Vamshi B

View Comments

Share
Published by
Vamshi B

Recent Posts

sql server detected logical consistency based error

Learn about SQL Server detecting logical consistency based issues and how to resolve them.

5 months ago

sql server error 1222

Learn about SQL Server error 1222 and how to resolve the lock request time out…

5 months ago

Microsoft SQL Server 2022 New Features

Discover the new features of Microsoft SQL Server 2022 and how they compare to previous…

5 months ago

SQL Server Error 1222 lock request time out period exceeded

SQL Server Error 1222 lock request time out period exceeded   Lock request time out…

6 months ago

SQL Server Error : 427, Severity: 20. Could not load the definition for constr

SQL Server Error : 427, Severity: 20. Could not load the definition for constraint ID…

10 months ago

SQL Server Error : 204, Severity: 20. Normalization error in node %ls.

SQL Server Error : 204, Severity: 20. Normalization error in node %ls.

10 months ago

This website uses cookies.