Identifying SQL Server Port Number

This article provides several ways to identify the TCP/IP port number used by SQL Server.

Find the Running Port Number through Query

The following query provides a direct answer about TCP/IP port used by the SQL Server, as well as the SQL Server’s IP address.

SELECT DISTINCT local_net_address, local_tcp_port 
FROM sys.dm_exec_connections 
WHERE local_net_address IS NOT NULL;

Find the Running Port Number through xp_readerrorlog

The command xp_readerrorlog read the SQL Server logs, which consists of SQL Server boot log, to find the SQL Server listening port through keywords in the boot log.

USE master
xp_readerrorlog 0, 1, N'Server is listening on'

Get the Running Port from the TCP/IP Properties

  1. Open the SQL Server Configuration Manager
  2. In the SQL Server Configuration Manager, under the SQL Server Network Configuration, select your SQL Server instance.
  3. After that, right click on TCP/IP and select Properties. You will find the SQL Server running port on the following screen.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.