If the SQL Server server is remote, this method will not work.
However, we can also check it by looking at the SQL Server server log.
If there is a lot of content in the log, it will be more troublesome to find.
Fortunately, SQL Server 2005 provides us with a very useful system stored procedure sp_readerrorlog.
(You may not find it in the SQL Server help documentation).
Closer to home, the following demonstration finds the port number of SQL Server through SQL statements: execsys.sp _ readerrorlog0, 1, listening' logdate process infotext-
SQL Server 2005 system extended stored procedure sys.readerrorlog can read SQL server server log files.
Note that the log file here refers to the SQL Server server log, not the log file of the SQL Server database.
Method 2: Click the bottom left of the computer to start -Microsoft SQL Server2005- Configuration Tools -SQL Server Configuration Manager-Expand Network Configuration-Click MYSQLSERVER Protocol-Double-click TCP/IP-Select IP address to view the port number.