sqlserver表查看被锁表和解锁方法

 时间:2026-02-15 11:41:37

1、---查看锁表

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

---spid 锁表进程 

---tableName 被锁表名 

---解锁语句

 declare @spid int 

 Set @spid = 136 

 --锁表进程

 declare @sql varchar(1000)set 

 @sql='kill '+cast(@spid as varchar)exec(@sql)

  • 3D打印模型如何防止翘边
  • 如何卸载安卓手机中的预装软件
  • 恋人如何重归于好
  • 大神级模拟器:UNETLAB\UNLEVE安装使用
  • 在家做干锅藕片的做法
  • 热门搜索
    知识产权出版社 dnf手游什么时候出 谈什么色变 交通规则知识 干柠檬片的功效与作用 骆驼奶的功效和作用 什么是中央厨房 蒲公英的功效与作用 resume什么意思 melody什么意思