一,查询死锁

//spid :被锁进程ID。

  //tableName:发生死锁的表名。


select
request_session_id spid, OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where resource_type='OBJECT'

二,杀掉死锁

KILL spid //kill 111234

 

三,显示死锁信息

exec sp_who2 spid

 

相关文章: