Get IP and Port number for MSSQL-server

Below is a T-SQL statement that lets you get information about the IP-address and TCP-port number for a Microsoft SQL-server.

SELECT CONNECTIONPROPERTY('local_net_address') AS IPAddress, CONNECTIONPROPERTY('local_tcp_port') AS PortNumber;

Leave a Reply

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