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?
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?
Either get a sysadmin to grant you the required VIEW SERVER STATE permission, or provide you with a signed stored procedure.