SyntaxFix
Write A Post
Hire A Developer
Questions
This is the one that works for me:
SELECT DISTINCT local_tcp_port FROM sys.dm_exec_connections WHERE local_tcp_port IS NOT NULL