SQL Server port Check
The parameters you can use with XP_READERRRORLOG are mentioned below for your reference:
1. Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc...
2. Log file type: 1 or NULL = error log, 2 = SQL Agent log
3. Search string 1: String one you want to search for
4. Search string 2: String two you want to search for to further refine the results
5. Search from start time
6. Search to end time
7. Sort order for results: N'asc' = ascending, N'desc' = descending
By default, there are six archived SQL Server Error Logs along with the ERRORLOG which is currently used. However, it is a Best Practice to increase the number of SQL Server Error Logs from the default value of six. Hence I recommend that you read this tip Increase the Number of SQL Server Error Logs.
If you use sp_cycle_errorlog to cycle the SQL Server Error Logs you will need to look in the archive files to find the port information, because this is only stored in the startup error log.
Also, if you are using endpoints, such as Database Mirroring these will show up as ports as well. The way to differentiate the ports being used is to look at the data where the ProcessInfo column equals 'Server' to find the port used for the database engine.
Identify Port used by SQL Server Database Engine Using SQL Server Configuration Manager
1. Click Start -> Programs -> Microsoft SQL Server 2008 -> Configuration Tools -> SQL Server Configuration Manager
2. In SQL Server Configuration Manager, expand SQL Server Network Configuration and then select Protocols for on the left panel. To identify the TCP/IP Port used by the SQL Server Instance, right click on TCP/IP and select Properties from the drop down as shown below.
3. In TCP/IP Properties window click on the IP Addresses tab and you will see the Port used by the instance of SQL Server in either TCP Dynamic Ports for a dymanic port or TCP Port for a static port as highlighted in the snippet below.