用SQL语句得到本机的IP或者是计算机名怎么写啊?高手指点,如果是两个连接怎么办,就是一个宽带,一个VPN连接的
解决方案 »
- 为什么数据室附加不了?
- 数据库查询问题
- 请问为什么我附加了一个数据库文件后,数据库的文件名上还带有路径?
- DataTabel读数据写入
- sqlserver2008ManagementStudio安装时报错让我把VS2008升级到SP1,但我已经升级了啊!怎么办?!
- 有个问题,没有分了,请大家多多包含!!!
- 请教一个汉字的ASCII码与汉字对应拼音的第一个字母的ASCII码之间的关系!
- 如何在SQL server 中实现用户登陆立即触发存储过程,如何提高执行存储过程的权限!!!!!
- 关于触发器的问题
- 请问一个数据库登陆用户,数据库用户,权限的问题。谢谢!!!!!!
- update是什么原理呢?
- 求一套面试题,要求如下
create table #ip(a varchar(200))
set @sql='ping '+host_name()+' -a -n 1 -l 1'
insert into #ip exec master..xp_cmdshell @sqlselect @ip=left(a,patindex('%:%',a)-1) from(
select a=substring(a,patindex('Ping statistics for %:%',a)+20,20)
from #ip where a like 'Ping statistics for %:%') a--显示结果
select 用户计算机名=host_name(),ip地址=@ipdrop table #ip
select serverproperty('ServerName');
select serverproperty('MachineName');
create table #ip(a varchar(200))
insert into #ip exec master..xp_cmdshell 'nbtstat -an'select @ip=left(a,patindex('%]%',a)-1) from(
select a=substring(a,patindex('%:%',a)+3,20)
from #ip where a like '%Node IpAddress%') a--显示结果
select 用户计算机名=host_name(),ip地址=@ipdrop table #ip
select 用户计算机名=host_name()
和这个结果不相同?