Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 how to get info about execution time

Author  Topic 

real_pearl
Posting Yak Master

106 Posts

Posted - 2004-11-04 : 03:50:38
When we run a procedure in Query Analyzer which takes around 30 minutes, the QA keeps on showing the time. Is there any way that we can get such information when the procedure is run from some where else.

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2004-11-04 : 03:54:40
set up profiler to get the required info.


He is a fool for five minutes who asks ,
but who does not ask remains a fool for life!

http://www.sqldude.4t.com
http://www.sqljunkies.com/weblog/sqldude
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-11-04 : 04:46:44
DECLARE @dtStart datetime
SELECT @dtStart = GetDate()
... do stuff here ...
SELECT DATEDIFF(Second, @dtStart, GetDate()) AS [Elapsed Time (Seconds)]

You could, of course, INSERT the Elapsed Time into a Log table, or something similar.

Kristen
Go to Top of Page
   

- Advertisement -