查看SQL数据库当前活动连接数
-
来源:石家庄网站建设 发表时间: 2010年11月16日 作者:石家庄轻程网络 浏览次数: 次
查看当前SQL数据库连接的基本语句为 sp_who
我们能把查询结果插入到我们自己定义的表(monitoruser)中
基本语句为
create table monitoruser
( spid int,
ecid int,
status varchar(200),
loginame varchar(200),
hostname varchar(200), \\根据sp_who的结果新建表结构
blk varchar(200),
dbname varchar(200),
cmd varchar(200),
[datetime] [datetime] not null
)
alter table [dbo].[monitoruser] with nocheck add
constraint [datetime] default (getdate()) for[datetime] \\自动获取时间插到datetime列中
go
insert into monitoruser(spid,ecid,status,loginame,hostname,blk,dbname,cmd)
exec (sp_who) \\执行sp_who,将结果插入到monitoruser中
网站制作,重点是细节,所以,一定要记得关闭打开的数据库连接。
相关内容
- 解决ie8支付宝问题
- httpd.ini 301 写法
- 屏蔽js错误
- 查看SQL数据库当前活动连接数
- SQL2005,循环conn.execute速度超
- conn.execute sql与rs.open sql
- Z-Blog目录权限设置
- ASP防止刷新代码
- iframe 背景透明
- ewebeditor在ie8下按钮无效的解决
- 网页设计的两大要点
- 建设制作必须考虑的4个基本方面
- 几个不错的网站素材网站
- 网站功能定位与实施
- iis 6.0 完整安装包 适用xp 不用
- serv-u 9.4 破解版
- aspjpeg组件 下载
- jmail组件下载
- aspemail发送邮件支持
- 几千元和几百元的网站有什么不同