One method is to save the time before and after the query and to calculate the difference, something like this:
DECLARE @start_time DATETIME, @end_time DATETIME
SET @start_time = CURRENT_TIMESTAMP
-- query goes here
SET @end_time = CURRENT_TIMESTAMP
SELECT DATEDIFF(ms, @start_time, @end_time)

0 comments:
Post a Comment