Find the Port Number for SQL Server Instance
Default port number for SQL Server connections is 1433. On the other hand, on purpose SQL Server administrators may change the default port number for their SQL Server instances. Or for cases where multiple SQL Server instances are installed on the same server, new instances will use different port numbers than the default port number 1433.
If you have problem to connect to a SQL Server instance using port number 1433, the cause can be the database instance could be using a different port number. To identify the port number on the current SQL Server instance, SQL developers can execute following SQL command.
SQL programmers can call xp_instance_regread extended stored procedure to read registry values. The registry key is 'Software\Microsoft\Microsoft SQL Server\MSSQLServer\SuperSocketNetLib\Tcp\IpAll' And the port number we are interested is stored in TcpDynamicPorts
As you can see below, my SQL Server instance (SQL Server 2019 CTP3) is using port number 63449 which is different than the default 1433 port number.