3中查询数据库连接数

SELECT * FROM
[Master].[dbo].[SYSPROCESSES] WHERE [DBID]
IN
(
  SELECT
   [DBID]
  FROM
   [Master].[dbo].[SYSDATABASES]
  WHERE
   NAME='SWT_MicroManage'
)
go
SELECT COUNT(*) AS CONNECTIONS FROM master..sysprocesses
go

SP_WHO 'swt'
go

posted @ 2014-07-08 12:40  快乐就好  阅读(227)  评论(0编辑  收藏  举报