Solved

get cpu usage required for query executed

Posted on 2003-12-10
3
141 Views
Last Modified: 2010-05-03
i am executing the queries using the recordset and ADODB connection with SQL server.how can i get all statistical information about query execution like cpu usage by the query, time for execution in miliseconds etc using Visual Basic code?
0
Comment
Question by:truptigadgil
3 Comments
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 130 total points
ID: 9913099
If you issue this statement to SQL Server:


SET STATISTICS PROFILE ON


then all the queries from then on will be executed, but they will return an extra recordset, this recordset contains the information you want.

You will need to parse the info out though.

SET SHOWPLAN_ALL ON does exactly the same thing only it does not run the query.

Look up SET SHOWPLAN_ALL and SET STATISTICS PROFILE in SQL Server books online for more info.

0
 
LVL 27

Expert Comment

by:planocz
ID: 10252186
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from truptigadgil from 12/10/2003 comment
Award points to nmcdermaid is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now