Wednesday, 14 November 2012

SQL Server TCP Port Number


Today I came accross an interesting TSQL in the blog spicifed below to find out the TCP Port number SQL Server instance was listening on,
 
 
SELECT      e.name,
            e.endpoint_id,
            e.principal_id,
            e.protocol,
            e.protocol_desc,
            ec.local_net_address,
            ec.local_tcp_port,
            e.[type],
            e.type_desc,
            e.[state],
            e.state_desc,
            e.is_admin_endpoint
FROM        sys.endpoints e 
            LEFT OUTER JOIN sys.dm_exec_connections ec
                ON ec.endpoint_id = e.endpoint_id
GROUP BY    e.name,
            e.endpoint_id,
            e.principal_id,
            e.protocol,
            e.protocol_desc,
            ec.local_net_address,
            ec.local_tcp_port,
            e.[type],
            e.type_desc,
            e.[state],
            e.state_desc,
            e.is_admin_endpoint
 
The Script works perfectly fine, I tried using DISTINCT instead of Group by that works fine too. Thanks to the blogger for the script.

3 comments:


  1. If you're looking for a reliable way to customize your apparel, consider using dtf transfers ready to press. These transfers are easy to apply and provide vibrant, long-lasting designs. Whether for personal projects or business orders, they offer a convenient solution for high-quality printing. For more options, visit the website and explore the available sizes.

    ReplyDelete