能不能根据实例名取得服务器的IP 另实例名一般就是服务器名字吧,ping应该也可以吧 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 exec master..xp_cmdshell 'ipconfig' DECLARE @hostname VARCHAR(100),@sql VARCHAR(1000)SELECT @hostname=HOST_NAME()SET @sql='ping -a -n 1 -l 1 '+@hostName EXEC master..XP_CMDSHELL @sql declare @cmdStr varchar(100)drop table #tablecreate table #table(id int identity,txt varchar(1000))select @cmdStr='ping '+@@servernameinsert into #table(txt) exec master..xp_cmdshell @cmdStrselect substring(txt,charindex('[',txt)+1,charindex(']',txt)-charindex('[',txt)-1) from #table where id=2 oracle 创建 存储过程编译错误 请高手指点!菜鸟 在线等 sql多表查询,统计 一次修改多行,如何用sql语句来实现? sql 查询不到数据 交叉表问题...求解 关于table类型的问题 SQL 显示当天所有记录 语句 视图中数据与表中数据不同步问题 SQL的update问题,请大家帮忙! 求助!如何用DAO方式打开经过加密的EXCEL文件? Access 提示查询太复杂,我该怎么办,老大,明天要教程序了(急) Foxpro的表,怎么搞到SQL Server中来啊
EXEC master..XP_CMDSHELL @sql
declare @cmdStr varchar(100)
drop table #table
create table #table(id int identity,txt varchar(1000))
select @cmdStr='ping '+@@servername
insert into #table(txt) exec master..xp_cmdshell @cmdStrselect substring(txt,charindex('[',txt)+1,charindex(']',txt)-charindex('[',txt)-1) from #table where id=2