查看被锁表:
执行这个sql
select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName
from sys.dm_tran_locks where resource_type='OBJECT'
tip:
– spid 锁表进程
– tablename 被锁表名称
解锁(例如):
declare @spid int
Set @spid = 57 --锁表进程 (将57这个数字替换成上面查询出来的被锁表对应的进程)
declare