是否可以使用存储过程获取mac地址? [英] Is it possible to get the mac address using a stored procedure?

查看:35
本文介绍了是否可以使用存储过程获取mac地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想知道是否可以使用存储过程获取服务器的 mac 地址?我做了一些搜索,但一无所获.这是使用SQL2008.

Was wondering if it was possible to get the mac address of the server using a stored procedure? I did some searching for a while but found nothing. This is using SQL2008.

更新
不幸的是,使用 newsequentialid() 的答案可能会返回错误如果服务器上有 VMWare,则为 MacAddress.

Update
Unfortunately the answer that uses newsequentialid() can return the wrong MacAddress if there is VMWare on the server.

推荐答案

我猜你需要从 SQL 执行一个 shell 命令来获取 MAC 地址.如果我没记错的话,您必须先打开执行 shell 命令选项,然后才能使用它.然后,您可以运行getmac"来检索服务器上接口的 MAC 地址列表.您必须按照自己的方式处理返回的文本,但这应该不会太难.

I would guess that you'd need to execute a shell command from SQL to get the MAC address. If I recall correctly, you have to turn on the execute shell command option before you can use it. Then, you could run "getmac" to retrieve a list of MAC address for the interfaces on the server. You'd have to work your way through the text returned, but that shouldn't be too hard.

这篇关于是否可以使用存储过程获取mac地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆