The CONNECTIONPROPERTY TSQL Function
The CONNECTIONPROPERTY function can be used to obtain information about the current connection. The information available is similar to the sys.dm_exec_connections system view.
SELECT 'Net Transport' AS Property, CONNECTIONPROPERTY('net_transport') AS Value
UNION ALL
SELECT 'Protocol type', CONNECTIONPROPERTY('protocol_type')
UNION ALL
SELECT 'Auth scheme', CONNECTIONPROPERTY('auth_scheme')
UNION ALL
SELECT 'Local net address', CONNECTIONPROPERTY('local_net_address')
UNION ALL
SELECT 'Local TCP port', CONNECTIONPROPERTY('local_tcp_port')
UNION ALL
SELECT 'Client net address', CONNECTIONPROPERTY('client_net_address');