1.查詢死鎖的業務表,排除程式慢sql造成的影響
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks where resource_type='OBJECT'
order by tablename;
2.查詢死鎖的阻塞程序
sys.sp_who
3.查詢思索的語句
dbcc inputbuffer(會話id);
1.查詢死鎖的業務表,排除程式慢sql造成的影響
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks where resource_type='OBJECT'
order by tablename;
2.查詢死鎖的阻塞程序
sys.sp_who
3.查詢思索的語句
dbcc inputbuffer(會話id);