SQL server2005连接与进程

select count(distinct net_address)-1 as 当前连接数 from master..sysprocesses;
select @@CONNECTIONS as 连接或试图连接数,@@MAX_CONNECTIONS as 允许的同时用户连接的最大数;
SELECT COUNT(*) AS 所有进程数 FROM master..sysprocesses;
SELECT cntr_value AS 用户进程数 FROM master..sysperfinfo as p
WHERE p.object_name = 'SQLServer:General Statistics' And p.counter_name = 'User Connections';
exec SP_WHO 'active' ;
SELECT *  FROM master..sysprocesses;
posted @ 2009-04-03 11:53  昕友软件开发  阅读(278)  评论(0编辑  收藏  举报
欢迎访问我的开源项目:xyIM企业即时通讯