SQL Server 数据库查询死锁的处理步骤
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);