select * from sysprocesses where dbid in (select dbid from sysdatabases where name='数据库名称') ORDER BY cpu DESC
sysprocesses 表中保存关于运行在 Microsoft® SQL Server™ 上的进程的信息。这些进程可以是客户端进程或系统进程。sysprocesses 只存储在 master 数据库中。
列名 数据类型 描述
spid smallint SQL Server 进程 ID。
kpid smallint Microsoft Windows NT 4.0® 线程 ID。
blocked smallint 分块进程的进程 ID (spid)。
waittype binary(2) 保留。
waittime int 当前等待时间&