Home » Microsoft » 70-473 v.2 » Which view should you query?
You have an application named App1 that uses a Microsoft Azure SQL database.
Some users report that they receive messages similar to the following error message: ‘oeTransaction (Process ID65) was deadlocked on locked resources with another process and has been chosen as the deadlock victim. Rerun the transaction.’
You need to identify the cause of the error.
Which view should you query?
A. sys.dm_os_wait_stats
B. sys.event_log
C. sys.resource_stats
D. sys.dm_tran_locks
Correct Answer: A
Explanation/Reference:
sys.dm_os_wait_stats returns information about all the waits encountered by threads that executed. One type if waits is queue waits, which occur when a worker
is idle, waiting for work to be assigned. Queue waits are most typically seen with system background tasks such as the deadlock monitor and deleted record cleanup tasks.
Incorrect Answers:
D: 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.
The columns in the result set are divided into two main groups: resource and request. The resource group describes the resource on which the lock request is being made, and the request group describes the lock request.
Reference: https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-wait-stats-transact-sql?view=sql-server2017