当前网站的mssql数据库连接数

SELECT count(*) from master..sysprocesses where dbid=db_id('DC_DRP')


SELECT * FROM
[Master].[dbo].[SYSPROCESSES] WHERE [DBID]
IN
(
  SELECT
   [DBID]
  FROM
   [Master].[dbo].[SYSDATABASES]
  WHERE
   NAME='DC_DRP'
)

你可能感兴趣的:(MSSQL)