Is it possible to get the mac address using a stored procedure?

前端 未结 6 778
一整个雨季
一整个雨季 2020-12-12 01:07

Was wondering if it was possible to get the mac address of the server using a stored procedure? I did some searching for a while but found nothing. This is using SQL2008.

6条回答
  •  借酒劲吻你
    2020-12-12 01:23

    DECLARE @IP_Address varchar(20);
    DECLARE @mac_Address varchar(20);
    
    SELECT @IP_Address=client_net_address,@mac_Address=net_address 
        FROM sys.dm_exec_connections c
        join sys.sysprocesses p on c.session_id=p.spid
        WHERE c.Session_id = @@SPID
    

提交回复
热议问题