雁过请留痕...
代码改变世界

sqlserver查看和解除表死锁

2017-01-23 13:29  xiashengwang  阅读(13607)  评论(1编辑  收藏  举报

1,查看那个表死锁

select object_name(resource_associated_entity_id) as tableName, request_session_id as pid from sys.dm_tran_locks
where resource_type = 'OBJECT'

2,结束死锁的进程

kill 70