Select system_user Current User name
, user_name () current owner
, db_name () Current database
, @ @SPID The current process number
, (select top 1 FileName from master.) sysdatabases where Name=db_name ()) database file
, host_id () client __id
, App_name () client program
, HOST_NAME () client computer
, (select top 1 net_address from Master.. sysprocesses where [email protected] @SPID) client _mac
, SERVERPROPERTY (' machinename ') server pc
, (select top 1 net_address from Master.. sysprocesses where hostname=serverproperty (' machinename ') server _mac
, Serverproperty (' ServerName ') SQL instance
, Serverproperty (' Edition ') SQL version
, Serverproperty (' productversion ') SQL version number
, Serverproperty (' productlevel ') SQL Patch SP
, Serverproperty (' ProcessID ') SQL Process ID
, @ @version Version information string
SQL gets the client NIC computer name and other information