Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6802493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:13:47+00:00 2026-05-26T19:13:47+00:00

I am creating an application that tracks some specific performance-related statistics from SQL Server

  • 0

I am creating an application that tracks some specific performance-related statistics from SQL Server for every query executed on the server. I can get most of the information through SQL Trace or more specifically, using the StatementCompleted and BatchCompleted event classes.

Using SQL Trace with the above events gives me everything except wait stats. I know I can get the wait statistics separately from the two Dynamic Management Views and Functions sys.dm_os_wait_stats and sys.dm_os_waiting_tasks.

I need to find a way to somehow club these two information together so that I can determine the wait stats on a per query basis. For example, I need to be able to answer a question like: How long did query X had to wait for an IO or CPU resource before it could begin execution?

I cannot answer this question accurately because SQL Trace does not give me this information. Is there anyway to obtain wait stats from SQL Server for every statement that is being executed on the server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:13:48+00:00Added an answer on May 26, 2026 at 7:13 pm

    If you are on SQL Server 2008 you can use extended events to capture details of the sqlos.wait_info event filtered on the spid of interest.

    See SQLSkills: Capturing wait stats for a single operation for example code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an application that will store geolocation data for specific transactions. Should I
I am creating application that simply reads data from an XML file and displays
I have an ASP.NET application which tracks statistics by creating and writing to custom
In my application, I will be creating multiple Audio Tracks, some of which will
I'm creating an application that will store a hierarchical collection of items in an
I am creating an application that manages multiple instances of an external utility, supplying
I am creating an application that uses popups. However, I would like to animate
I am creating an application that will have a list of items that can
I am currently in the process of creating an application that records current location
We are creating an XBAP application that we need to have rounded corners in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.