易截截图软件、单文件、免安装、纯绿色、仅160KB

如何用sql命令获取ip地址 - MS-SQL Server / 应用实例

如何用sql命令获取当前数据库服务器的ip地址
学习,帮顶

SQL code:
exec master..xp_cmdshell 'ipconfig'


SQL code:
SELECT @@SERVERNAME


SQL code:
create Procedure sp_get_ip_address (
@ip varchar(40) out
)
as
begin
Declare @ipLine varchar(200)
Declare @pos int
set nocount on
set @ip = NULL
Create table #temp (ipLine varchar(200))
Insert #temp exec master..xp_cmdshell 'ipconfig'
select @ipLine = ipLine from #temp where upper (ipLine) like '%IP ADDRESS%'
if (isnull (@ipLine,'***') != '***')
begin
set @pos = CharIndex (':',@ipLine,1);
set @ip = rtrim(ltrim(substring (@ipLine ,@pos + 1 ,len (@ipLine) - @pos)))
end
drop table #temp
set nocount off
end
go
declare @ip varchar(40)
exec sp_get_ip_address @ip out print @ip


SQL code:
create table #tmp(aa varchar(200))
insert #tmp exec xp_cmdshell 'ipconfig'
select s


相关问答:

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

关于Vb中sql语句的写法(100分) - Java / Web 开发

求个vb中的sql语句的写法,次sql语句的用法是分页程序
我写的如下:其中A是用来接收每页显示的记录的条数,B是用来接收显示的当前的页面.
sqltext="select top A * from log where id not in(select top ( ......

mysql区没高手 - MS-SQL Server / 基础类

我觉得mysql和sqlserver有共同的地方:
有个问题是关于表的锁问题:
进程A 进程B
select * from user where id in lock share mode(共享锁)
&nb ......

SQL不明白 - MS-SQL Server / 应用实例

查询学生平均成绩及其名次 
  SELECT 1+(SELECT COUNT( distinct 平均成绩) 
  from (SELECT S#,AVG(score) AS 平均成绩 
  from SC&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号