网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

阻塞者及阻塞数量

With T
As
(
Select ROW_NUMBER() over (order by spid) as id, spid,blocked From (select distinct spid,blocked from sys.sysprocesses where spid in
    (Select blocked from sys.sysprocesses where blocked <>0) and blocked=0) S
Union All
Select  id,TB.spid,TB.blocked  From sys.sysprocesses TB Inner Join T on TB.blocked=T.SPID  AND TB.blocked<>TB.spid
),
U
AS
(select distinct a.spid,last_batch,program_name,nt_username,loginame,db_name(a.dbid) as 'dbname',OBJECT_NAME(resource_associated_entity_id,a.dbid) as 'tablename',request_mode,request_type,open_tran,waittype,status,hostname,cmd,b.text as TSQL
from sys.sysprocesses a 
cross apply sys.dm_exec_sql_text(a.sql_handle) b 
inner join sys.dm_tran_locks c on a.spid=c.request_session_id and resource_type='OBJECT' and request_mode not like 'Sch%'
where spid in
    (Select blocked from sys.sysprocesses where blocked <>0) 
    and a.blocked=0
)
select U.spid,blockeds,last_batch,program_name,nt_username,loginame,dbname,tablename,request_mode,request_type,open_tran,waittype,status,hostname,cmd,tsql from U inner join (Select distinct COUNT(id) over (partition by id)-1 as blockeds,C.spid From T A cross apply (select TOP 1 SPID from T B WHERE A.id=B.id AND B.blocked=0)C) BlKS ON U.spid=BLKS.spid;
![](/upload/otherpic71/171157.jpg)

分享名称:阻塞者及阻塞数量
网页网址:http://bjjierui.cn/article/peopcg.html

其他资讯