0%
Loading ...

Measure Ms Sql Execution time in resolution of milliseconds

Sql Logo No Version

DECLARE @t1 DATETIME;
DECLARE @t2 DATETIME;

SET @t1 = GETDATE();

/* Put here the query to measure */;

SET @t2 = GETDATE();
SELECT DATEDIFF(millisecond,@t1,@t2) AS elapsed_ms;