sql server 查看是否有死锁
一.查看那个表死锁
select object_name(resource_associated_entity_id) as tableName, request_session_id as pid from sys.dm_tran_locks
where resource_type = 'OBJECT';
结果如下图:
二.结束死锁的进程
KILL 83
KILL 78
KILL 77
KILL 81
KILL 110
KILL 99
一.查看那个表死锁
select object_name(resource_associated_entity_id) as tableName, request_session_id as pid from sys.dm_tran_locks
where resource_type = 'OBJECT';
结果如下图:
二.结束死锁的进程
KILL 83
KILL 78
KILL 77
KILL 81
KILL 110
KILL 99