|
i want to get the total time taken by sql server 2005 in executing a query
(comments are locked)
|
|
You probably want to use Be careful though, there are different 'times'
Our very own @Fatherjack blogged on this problem here: http://www.simple-talk.com/community/blogs/jonathanallen/archive/2011/02/23/100137.aspxand here http://www.simple-talk.com/community/blogs/jonathanallen/archive/2011/02/28/100431.aspx
Aug 12 '11 at 03:25 AM
ThomasRushton ♦
(comments are locked)
|
|
As @Kev wrote, you can use the If you are executing the query from SSMS, you can also tick the Include Client Statistics, which contains also execution times and other useful information. I didn't see that you'd already posted that. I deleted my post.
Aug 12 '11 at 04:47 AM
Grant Fritchey ♦♦
(comments are locked)
|
|
You can also get "grand" total execution time for the query from sys.dm_exec_query_stats. The query below works with SQL 2005 and later and will give you total/max/min/avg execution time, number of execution, total physical and logical reads:
(comments are locked)
|
|
In it's simplest form my preference is Getting deep details from the dmvs as @Hakan Winther shows is the better option if you want to do proper analysis
(comments are locked)
|

