USE master
GO
xp_readerrorlog 0, 1, N'Server is listening on'
GO
#LogDate ProcessInfo Text
#... Server Server is listening on [ ::1 <ipv6> 1434].
#2.. Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
By default SQL Server listens on TCP port number 1433, but for named instances the TCP port is dynamically configured. There are several options available to get the listening port for a SQL Server named instance.