SQL Server查看某个数据库的连接



SELECT * FROM
[Master].[dbo].[SYSPROCESSES] WHERE [DBID]
IN
(
  SELECT
   [DBID]
  FROM
   [Master].[dbo].[SYSDATABASES]
  WHERE
   NAME='databaseName'
)   --查看数据库连接



select * from sysprocesses where dbid in (select dbid from sysdatabases where name='DBname')  --查看数据库链接



#########################

迷途小运维随笔 整理自网络

转载请注明出处

作者:john

你可能感兴趣的:(MSSQL)