HOTSPOT
You have a Microsoft Azure SQL database.
Some queries take a long time to execute.
You need to identify whether any of the long-running queries prevent users from updating data in the database.
Which query should you execute? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Answer:
Explanation:
Box 1: sys.dm_tran_locks sys.dm_tran_locks returns information about currently active lock manager resources in SQL Server 2017. Each row represents a currently active request to the lock manager for a lock that has been granted or is waiting to be granted.
Box 2: sys.dm_os_waiting_tasks sys.dm_tran_locks.lock_owner_address is the memory address of the internal data structure that is used to track this request. This column can be joined the with resource_address column in sys.dm_os_waiting_tasks.
References: https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-managementÂviews/sys-dm-tran-locks-transact-sql?view=sql-server-2017