create procedure dbo.sp_spidtoip @spid int as — spid to mac — lj declare @mac as varchar(12) select @mac = net_address from master..sysprocesses where spid = @spid — mac to ip declare @macdisplay as varchar(18) declare @ip as varchar(15) create table #temp (output varchar(255) null) set nocount on insert into #temp exec master..xp_cmdshell arp -a if @@error begin raiserror (the level for job_id:%d should be between %d and %d., 16, 1) –rollback transaction end select @macdisplay = left(@mac, 2) + – + substring(@mac, 3, 2) + – + substring(@mac, 5, 2) + – + substring(@mac, 7, 2) + – + substring(@mac, 9, 2) + – + substring(@mac, 11, 2)select @ip = substring(output, 3, 15) from #temp where output like % + @macdisplay + % — resolve the ip –declare @cmd as varchar(100) –select @cmd = master..xp_cmdshell “ping -a + @ip + ” –exec (@cmd) drop table #temp set nocount off go
根据进程号获取该进程所在客户端的ip地址-数据库专栏,SQL Server
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 根据进程号获取该进程所在客户端的ip地址-数据库专栏,SQL Server
相关推荐
-      DataGrid中的按钮反选事件与NamingContainer(命名容器)-downmoon-ASP教程,数据库相关
-      根据数据表中数据,生成Powerpoint幻灯片-ASP教程,数据库相关
-      使用用VB处理MYSQL数据库中二进制数据问题-.NET教程,VB.Net语言
-      关于DataGridView中如何接收处于编辑状态下的当前信息-ASP教程,数据库相关
-      ActiveMQ4.1+Spring2.0的POJO JMS方案(上)-.NET教程,数据库应用
-      ASP.NET 2.0中直接将Access数据库导入到Excel文件中-.NET教程,Asp.Net开发
-      DataGrid的多行提交-.NET教程,数据库应用
-      一个简单的asp数据库操作类-ASP教程,数据库相关
