• 00
  • :
  • 00
  • :
  • 00

SQL查看表锁定,死锁解锁

  
 1 select   request_session_id   spid,OBJECT_NAME(resource_associated_entity_id) tableName   
 2 
 3 from   sys.dm_tran_locks where resource_type='OBJECT'
 4 
 5 declare @spid  int 
 6 
 7 Set @spid  =260 --锁表进程
 8 
 9 declare @sql varchar(1000)
10 
11 set @sql='kill '+cast(@spid  as varchar)
12 
13 exec(@sql)

 

posted @ 2013-12-20 13:46  Garson_Zhang  阅读(284)  评论(0编辑  收藏  举报