Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where I found out milliseconds for the execution of a query in SQL Server 2008 management studio?

Where I found out milliseconds for the execution of a query in SQL Server 2008 Management Studio?

In Actual Execution Plan I cannot see the time.

like image 211
GibboK Avatar asked Mar 14 '13 12:03

GibboK


2 Answers

use SET STATISTICS TIME ON/OFF in beginning and end of query

like image 177
JackLock Avatar answered Oct 15 '22 14:10

JackLock


Several places:

  • sys.dm_exec_query_stats has last_worker_time and last_elapsed_time
  • SQL:StmtCompleted captures Duration
  • Ditto for RPC:Completed
  • Ditto for SP:StmtCompleted
  • set statistics time on as Jack already pointed out
  • XEvents track basically everything and more.
like image 37
Remus Rusanu Avatar answered Oct 15 '22 15:10

Remus Rusanu