SQLserver 表锁住已经锁住表所执行的语句

---查找锁住的表已经相关的进程

select object_name(resource_associated_entity_id) as tableName, request_session_id as pid from sys.dm_tran_locks
where resource_type = 'OBJECT' and object_name(resource_associated_entity_id) ='T_Purchase_Detail'
---查看锁住的进程执行的语句
DBCC INPUTBUFFER (402)

posted @ 2020-09-25 15:11  紫藤球球  阅读(334)  评论(0编辑  收藏  举报