Sql获取MAC地址软件注册实用

来源:互联网 发布:数控铣床怎么编程 编辑:程序博客网 时间:2024/05/22 09:50

软件注册中,可以使用获取Sql服务器Mac来获得许可权。

取得Mac

declare @dbid int
set @dbid=db_id('db_Stuey')
select distinct hostname,
         db_name(dbid),
         net_address,
         loginame,
         program_name
from master..sysprocesses   
where hostname!=''and(@dbid is null or dbid=@dbid) 
 
 
取得sa
declare @dbid int
set @dbid=db_id('數據庫名')
select distinct hostname,
         db_name(dbid),
         net_address, --物理地址
         loginame,
         program_name
from master..sysprocesses   
where hostname='服務器名'and(@dbid is null or dbid=@dbid)
 
 
 
可以使用最简单的方法,直接获取Sql服务器的Mac,一句话搞定!
select distinct net_address from master..sysprocesses where hostname!=''
 

 

原创粉丝点击