代码如下:USE masterDECLARE @spid intDECLARE CUR CURSORFOR SELECT spid FROM sysprocesses WHERE dbid = 5FETCH NEXT FROM CUR INTO @spidWHILE @@FETCH_STATUS = 0BEGIN–EXEC (‘KILL ‘ + @spid )FETCH NEXT FROM CUR INTO @spidENDCLOSE CURDEALLOCATE CUR 您可能感兴趣的文章:sqlserver进程死锁关闭的方法Sq