Lzx4627
Lzx4627

Reputation: 81

SQL Server : get client tcp port without admin user

First, my SQL Server user didn't have sysadmin permissions, and I want to get client port like

SELECT client_tcp_port 
FROM sys.dm_exec_connections 
WHERE session_id = @@SPID;

How can I get this information with T-SQL?

Upvotes: 0

Views: 189

Answers (1)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 88852

Either get a sysadmin to grant you the required VIEW SERVER STATE permission, or provide you with a signed stored procedure.

Upvotes: 1

Related Questions