To get the port number used by your MSSQL-server, you can use the command below.
SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID GO
To get the port number used by your MSSQL-server, you can use the command below.
SELECT local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID GO