locked
SQL Server table level locks RRS feed

  • Question

  • Hi,

    How can we find the locks on a particular object (table/view) ?

    Thanks,


    Vinodh Selvaraj

    Tuesday, February 23, 2016 12:48 PM

Answers

All replies

  • See List all Locks of the Current Database ; in the script you can filter on "obj.name" for a particcular object.

    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Tuesday, February 23, 2016 12:52 PM
    Answerer
  • Hi,

    How can we find the locks on a particular object (table/view) ?

    Thanks,


    Vinodh Selvaraj

    Use DMV sys.dm_tran_locks and sys.dm_os_waiting tasks. Run select * on both find the common column and join them and filter out. Request_session_id from 1st and session_id from 2nd DMV is what join will be based on


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Wiki Articles

    MVP


    Tuesday, February 23, 2016 2:00 PM
    Answerer