June 17, 2011 at 4:53 am
Please somebody suggest , query to know how long does lock exist on the data i.e start and end time of the lock
June 17, 2011 at 5:05 am
June 17, 2011 at 6:46 am
End time you're only going to get by inference. If you check for the lock regularly and it's gone, that's when it ended.
Start time on a lock is pretty easy and there are lots of places to get it. You can query sys.dm_tran_locks to see all the information you'd need about the lock itself. You'd have to join that DMO to others to get more details about what query is running, etc.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply