In a database file sometimes the table record is locked. A typical program will control this lock and unlock and manage it. But sometimes due to system crash or someother malfunction a lock may not be removed by the program and the system will prevent other users from using that record which is locked by the crashed system. How to find which user locked a table record? Is there anyway to find which user placed a lock on a table record?
Loading
Mohammad HussainPosted Sep 7, 2023, 2:15 PM
Try This..
Use sp_lock to get lock information
This will show all locks held by the current session. You can filter by the DBID and ObjId to find table locks.
or try this
This will show key/row locks on a specific table.
Tahir AnsariPosted Sep 6, 2023, 8:11 PM
This query can help you identify blocking sessions, but it might not provide the exact information about which user initiated the lock on a specific record