How can query the cumulative wait stats for a session

博雄 胡 545 Reputation points
2024-12-30T02:56:57.6833333+00:00

Starting from 2016, support for sys.dm_exec_session_wait_stats has been available. How should I query it before 2016?

If we use while and sys.dm_exec_session_wait_stats, I think theoretically it is also unreliable because one execution may take two intervals of time, resulting in missed collection.

My requirement is to query the waiting information during SQL execution. If you have any other ideas, I am very much looking forward to your help

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,279 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emad Al-Mousa 0 Reputation points
    2025-01-12T13:50:19.4+00:00

    Hi,

    its strongly recommended to move out of sql server 2014, as its ready reached end of support: https://learn.microsoft.com/en-us/lifecycle/products/sql-server-2014

    with newer versions you will have more improved features regarding wait stats.

    Thanks

    Emad

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.