To view the locked table:
Select SpId from
Master. sysprocesses
where db_name (dbID) = ' database name ' and
spId <> @ @SpId and
DbID <> 0
Unlock:
EXEC (' Kill ' +cast (@spid as varchar))
To view the locked table:
Select request_session_id spid,object_name (resource_associated_entity_id) tablename from
sys.dm_tran_locks where resource_type= ' OBJECT '
SPID Lock Table Process
TableName Locked Table name
Unlock:
declare @spid int
Set @spid = 57--Lock table process
declare @sql varchar (1000)
set @sql = ' Kill ' +cast (@spid as varchar) C17/>exec (@sql)
The above is a small set of SQL Server to introduce how to view the locked table and unlock the method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!