如何查看客户端的IP地址,机器名,MAC地址,登陆名等信息
select s.session_id,s.login_time,s.host_name,p.loginame,s.program_name,c.client_net_address,c.client_tcp_port,p.net_address as client_mac_address, c.local_net_address,c.local_tcp_port,c.net_transport
from sys.dm_exec_connections c join sys.dm_exec_sessions s on c.session_id = s.session_id join sys.sysprocesses p
on s.session_id = p.spid