Solved

get cpu usage required for query executed

Posted on 2003-12-10
3
147 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

690 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