用户量过大,防止数据库死锁
use master
Create Procedure dbo.spKillLockS
as
declare @spid varchar(10)
DECLARE Abc CURSOR FOR
select spid --‘死锁的进程‘
from master..sysprocesses a join (
select blocked from master..sysprocesses group by blocked
)b on a.spid=b.blocked where
a.dbid=db_id(‘FumaCRM8‘) and a.blocked=0
Open Abc
FETCH NEXT FROM Abc INTO @spid
WHILE (@@FETCH_STATUS = 0)
BEGIN
exec(‘kill ‘+@spid)
FETCH NEXT FROM Abc INTO @spid
END
close Abc
DEALLOCATE Abc
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。