读书人

====== 怎么用SQL语句把主机名转成IP地

发布时间: 2012-01-12 22:11:58 作者: rapoo

====== 如何用SQL语句把主机名转成IP地址? ======
如何用SQL语句把主机名转成IP地址?

比如: (local) -> 192.168.0.2

. -> 192.168.0.2

myserver -> 192.168.0.2


[解决办法]
这个可能要用到API吧。。呵呵~~不清楚,帮顶
[解决办法]
if object_id( 'TestTable ') is not null
drop table TestTable
create table TestTable(a varchar(1000))
insert TestTable exec master..xp_cmdshell 'ping 主机名 '
select substring(a,charindex( '[ ',a)+1,charindex( '] ',a)-charindex( '[ ',a)-1) from TestTable where charindex( '[ ',a)> 0
[解决办法]
上的必用SA行
[解决办法]
学习

读书人网 >SQL Server

热点推荐