on 11-22-2016 2:56 PM - last edited on 02-03-2024 5:47 PM by postmig_api_4
Hi community,
I'd like to know if there are ways to get a list or a summary of locks held by a SQL statement?
I was thinking of executing sp_sysmon during my unitary tests but the output might be 'polluted' by other SQL queries running at the same time.
I was thinking of using monLocks but I'm worried I could mess the data returned by monLock (for example if I search for a specific SPID, how do I know I'm viewing the correct SPID because I think SPID values can be reused - this actually opens a new question how can I uniquely identify a SQL statement execution if SPID is not enough)
Last, using sp_object_stats but this means I'll need to run this test on an environment where we could reproduce concurrency access which might not be easy except on production.
This question is raised because I have a client that is concerned about locking that could happen if a table is access by a SPID through an UPDATE/INSERT statement an other SPID in SELECT statement
Thanks for your comments
Simon
Thank you Bret and Mark,
Your comments answered my question.
Best,
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.