--这里有几个,不知道你需要不?
原帖地址
http://topic.csdn.net/u/20080125/21/ed6a4584-0588-4ae8-88c6-155eba3e1295.html?1750860928可以得网卡的create table #tb(id int identity(1,1),hostname nchar(128),loginname nchar(128),net_address nchar(12),net_ip nvarchar(15))
insert into #tb(hostname,net_address,loginname)
select distinct hostname,net_address,loginame from master..sysprocesses where hostname<>''declare @id int,@sql varchar(500)
select @id=max(id) from #tbcreate table #ip(id int,a varchar(8000))
while @id>0
begin
select @sql='ping '+hostname from #tb where id=@id
insert #ip(a) exec master..xp_cmdshell @sql
update #ip set id=@id where id is null
set @id=@id-1
endupdate #tb set net_ip=left(a,patindex('%:%',a)-1)
from #tb a inner join (
select id,a=substring(a,patindex('Ping statistics for %:%',a)+20,20) from #ip
where a like 'Ping statistics for %:%') b on a.id=b.idselect * from #tbdrop table #tb,#ip
-------------------------------------
declare @ip varchar(15),@sql varchar(1000)--得到ip地址
create table #ip(a varchar(200))
set @sql='ping '+host_name()+' -a -n 1 -l 1'
insert into #ip exec master..xp_cmdshell @sqlselect @ip=left(a,patindex('%:%',a)-1) from(
select a=substring(a,patindex('Ping statistics for %:%',a)+20,20)
from #ip where a like 'Ping statistics for %:%') a--显示结果
select 用户计算机名=host_name(),ip地址=@ipdrop table #ip/*用户计算机名 ip地址
-------------------------------------------------------------------------------------------------------------------------------- ---------------
FLYSTONE 192.168.0.76
*/
--------------------------------------网卡ID
DECLARE @NetID VARCHAR(32)
EXEC master..xp_by02 @NetID OUTPUT
select @NetID
------
--显示芯片信息
exec xp_msver 'Platform'--可参照联机帮助,有几项选择--处理器类型
exec xp_msver 'ProcessorType'
--------------------------------
原帖地址
http://topic.csdn.net/u/20080125/21/ed6a4584-0588-4ae8-88c6-155eba3e1295.html?1750860928可以得网卡的create table #tb(id int identity(1,1),hostname nchar(128),loginname nchar(128),net_address nchar(12),net_ip nvarchar(15))
insert into #tb(hostname,net_address,loginname)
select distinct hostname,net_address,loginame from master..sysprocesses where hostname<>''declare @id int,@sql varchar(500)
select @id=max(id) from #tbcreate table #ip(id int,a varchar(8000))
while @id>0
begin
select @sql='ping '+hostname from #tb where id=@id
insert #ip(a) exec master..xp_cmdshell @sql
update #ip set id=@id where id is null
set @id=@id-1
endupdate #tb set net_ip=left(a,patindex('%:%',a)-1)
from #tb a inner join (
select id,a=substring(a,patindex('Ping statistics for %:%',a)+20,20) from #ip
where a like 'Ping statistics for %:%') b on a.id=b.idselect * from #tbdrop table #tb,#ip
-------------------------------------
declare @ip varchar(15),@sql varchar(1000)--得到ip地址
create table #ip(a varchar(200))
set @sql='ping '+host_name()+' -a -n 1 -l 1'
insert into #ip exec master..xp_cmdshell @sqlselect @ip=left(a,patindex('%:%',a)-1) from(
select a=substring(a,patindex('Ping statistics for %:%',a)+20,20)
from #ip where a like 'Ping statistics for %:%') a--显示结果
select 用户计算机名=host_name(),ip地址=@ipdrop table #ip/*用户计算机名 ip地址
-------------------------------------------------------------------------------------------------------------------------------- ---------------
FLYSTONE 192.168.0.76
*/
--------------------------------------网卡ID
DECLARE @NetID VARCHAR(32)
EXEC master..xp_by02 @NetID OUTPUT
select @NetID
------
--显示芯片信息
exec xp_msver 'Platform'--可参照联机帮助,有几项选择--处理器类型
exec xp_msver 'ProcessorType'
--------------------------------
解决方案 »
- 关于SQL Server同步技术
- 问一个Entity sql的写法
- CAST函数
- 建oracle链接服务器成功,却不能查询数据
- ?????????????????W??W????????:SQL-server???W?????W??W???????????????????????????W????????????????W????????
- SQL 2005安装 之前装了2012 卸载之后装200就有各种问题
- 既然不能捕获,SQL 严重级别10以下的错误有何用处?
- txlicenhe(马可)
- wheretofindhelp?
- 急救!如何实现这样的SQL?
- 請教一觸發器問題
- 请问下这个sql语句怎么编 急用 详细在里面
-------------------------------------------------------------------------------------------------------------------------------- ---------------
FLYSTONE 192.168.0.76
*/
---
龟呀,这是我的机器名呀,你真黑