Solved

How to find total execution time for a query or stored procedure?

Posted on 2006-06-27
4
398 Views
Last Modified: 2012-08-14
Is there any way to find total execution time for a query or stored procedure?
0
Comment
Question by:ynaina
4 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 25 total points
ID: 16991320
Method 1 : Use SQL server Profiler
Method 2 :

DECLARE @TimeIn datetime
SET @TimeIn  = getdate()

exec spName

SELECT DATEDIFF(mm, @timeIn, Getdate() ) as 'ExecutionTime'
0
 
LVL 50

Assisted Solution

by:Lowfatspread
Lowfatspread earned 25 total points
ID: 16991337
technically

only method1 will allow you to obtain the execution time...

method2 just gives you the elapsed time...

;-)
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

706 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