--这里有几个,不知道你需要不?
原帖地址
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'
--------------------------------

解决方案 »

  1.   

    /*用户计算机名                                                                                                                           ip地址            
    -------------------------------------------------------------------------------------------------------------------------------- --------------- 
    FLYSTONE                                                                                                                         192.168.0.76
    */
    ---
    龟呀,这是我的机器名呀,你真黑
      

  2.   

    你可以用注入来调用一个外部程序得到序列号,然后写入到一个文件中,然后使用T-Sql读出文件中的内容!就可以得到了,可惜今天放假,我有这方面的例子可以给你,其实这也算T-Sql的内容!我做过T-Sql版本的读写Ini文件的函数!
      

  3.   

    要写扩展存储过程.或相关的OCX...在SQL里调用.