create table #ip(id int identity(1,1),re varchar(200))
declare @s varchar(1000)set @s='ping '+host_name()+' -a -n 1 -l 1'insert #ip(re) exec master..xp_cmdshell @s
select 登录的用户=suser_sname(),计算机名=host_name(),IP地址=stuff(left(re,charindex(']',re)-1),1,charindex('[',re),'')from #ipwhere id=2
drop table #ip
转载于:https://www.cnblogs.com/zndavid/archive/2004/08/27/36972.html
相关资源:各显卡算力对照表!