SQL Server查询锁等待

SELECT  
der.[session_id], 
[request_id], 
percent_complete, 
estimated_completion_time/1000/60, 
con.[client_net_address], 
con.local_net_address, 
[start_time] AS '开始时间', 
[status] AS '状态', 
[command] AS '命令', 
dest.[text] AS 'sql语句', 
DB_NAME([database_id]) AS '数据库名', 
[blocking_session_id] AS '正在阻塞其他会话的会话ID', 
[wait_type] AS '等待资源类型', 
[wait_time] AS '等待时间', 
[wait_resource] AS '等待的资源', 
[reads] AS '物理读次数', 
[writes] AS '写次数', 
[logical_reads] AS '逻辑读次数', 
[row_count] AS '返回结果行数', 
[cpu_time], 
percent_complete 
FROM sys.[dm_exec_requests] AS der 
outer APPLY 
sys.[dm_exec_sql_text](der.[sql_handle]) AS dest 
left join sys.dm_exec_connections con 
on der.session_id=con.session_id 
--WHERE der.[session_id]>50 -- AND 
--DB_NAME(der.[database_id])='' 
ORDER BY [reads] DESC

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值