Multiple choice technology databases

Which of the below is used to get the system lock information?

  1. sp_who

  2. sys.dm_tran_locks

  3. @@lock_timeout

  4. sp_lock

  5. None of the above

Reveal answer Fill a bubble to check yourself
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.