参考 https://www.cnblogs.com/lumnm/archive/2009/08/29/1556349.html
SELECT * FROM[Master].[dbo].[SYSPROCESSES] WHERE [DBID] IN ( SELECT [DBID]FROM [Master].[dbo].[SYSDATABASES]WHERE NAME='DBNAME')