| |

Unable to determine the TCP port number used by Microsoft SQL server ‘.\MSSQLSERVER2016

The warning “Unable to determine the TCP port number used by Microsoft SQL server ‘.\MSSQLSERVER2016′” indicates that the SQL Server instance is either not configured to use TCP/IP, or it is configured to use dynamic TCP ports. To resolve this and enable automatic firewall configuration for remote access, the SQL Server instance needs to be configured to listen on a specific, fixed TCP port.
Here are the steps to configure a fixed TCP port for your SQL Server instance:
  • Open SQL Server Configuration Manager:
    • Press Windows Key + R to open the Run dialog.
    • Type SQLServerManager13.msc (for SQL Server 2016) and press Enter.
  • Enable TCP/IP Protocol:
    • In SQL Server Configuration Manager, expand SQL Server Network Configuration.
    • Click on Protocols for MSSQLSERVER2016 (or the name of your specific instance).
    • In the right pane, right-click on TCP/IP and select Enable if it’s not already enabled.
    • Configure a Fixed TCP Port:
      • Right-click on TCP/IP and select Properties.
      • Go to the IP Addresses tab.
      • Scroll down to the IPAll section.
      • In the TCP Dynamic Ports field, ensure it is empty. If it contains 0, delete it.
      • In the TCP Port field, enter a specific port number (e.g., 1433, which is the default SQL Server port). Ensure this port is not in use by another application.
      • Click OK.
  • Restart SQL Server Service:
    • In SQL Server Configuration Manager, go to SQL Server Services.
    • Right-click on SQL Server (MSSQLSERVER2016) and select Restart.
  • Configure Windows Firewall:
    • Open Windows Firewall with Advanced Security.
    • Create a new Inbound Rule to allow connections on the TCP port you configured (e.g., 1433) for the SQL Server executable (sqlservr.exe).
After completing these steps, the SQL Server instance will be listening on the specified fixed TCP port, allowing for easier firewall configuration and remote access.

Similar Posts