SQL Server Management Studio, how to get execution time down to milliseconds

Michael Goldshteyn picture Michael Goldshteyn · Nov 23, 2011 · Viewed 152k times · Source

When I submit a batch (e.g., perform a query) in SSMS, I see the time it took to execute in the status bar. Is it possible to configure SSMS to show the query time with millisecond resolution?

Here is the bar I am talking about with the section of interest circled in red:

enter image description here

Answer

user596075 picture user596075 · Nov 23, 2011

What you want to do is this:

set statistics time on

-- your query

set statistics time off

That will have the output looking something like this in your Messages window:

SQL Server Execution Times: CPU time = 6 ms, elapsed time = 6 ms.