sp_lock

 select  convert (smallint, req_spid) As spid,
  rsc_dbid As dbid,db.name as DBName,
  rsc_objid As ObjId,object_name(rsc_objid) as ObjectName,
  rsc_indid As IndId,
  substring (v.name, 1, 4) As Type,
  substring (rsc_text, 1, 16) as Resource,
  substring (u.name, 1, 8) As Mode,
  substring (x.name, 1, 5) As Status

 from  master.dbo.syslockinfo,
  master.dbo.spt_values v,
  master.dbo.spt_values x,
  master.dbo.spt_values u,
  master.dbo.sysdatabases db

 where   master.dbo.syslockinfo.rsc_type = v.number
   and v.type = 'LR'
   and master.dbo.syslockinfo.req_status = x.number
   and x.type = 'LS'
   and master.dbo.syslockinfo.req_mode + 1 = u.number
   and u.type = 'L' and db.dbid=rsc_dbid and rsc_objid>0
 order by spid

相关文章:

  • 2021-07-31
  • 2022-01-15
  • 2021-12-10
  • 2022-12-23
  • 2021-12-10
  • 2021-12-17
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2022-01-31
  • 2022-01-26
相关资源
相似解决方案