Which of the below is used to get the system lock information?
-
sp_who
-
sys.dm_tran_locks
-
@@lock_timeout
-
sp_lock
-
None of the above
D
Correct answer
Explanation
sp_lock is a legacy system stored procedure that returns information about locks. However, it has been deprecated since SQL Server 2005, and the recommended approach is to use the sys.dm_tran_locks DMV, which provides more detailed and current lock information.