DECLARE @StartTime DATETIME DECLARE @EndTime DATETIME DECLARE @TimeDifference DATETIME SELECT @StartTime = GETDATE() ------------------------------------ Your Qurey Here ---------------------------------- SELECT @EndTime = GETDATE() SET @TimeDifference = @EndTime - @StartTime SELECT DATEDIFF(millisecond,@StartTime,@EndTime) AS TotalMilliSecondsTaken SELECT DATEDIFF(second,@StartTime,@EndTime) AS TotalSecondsTaken SELECT DATEDIFF(minute,@StartTime,@EndTime) AS TotalMinutesTaken select @TimeDifference as Difference,@EndTime as EndTime, @StartTime as StartTime
Mainly serves as my backup reference on programming & technology. Plus some random thoughts
- HOME
- PROGRAMMING
- TECHNOLOGIES
- GENERAL
- ABOUT ME
Finding the total query execution time
2011-05-08
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment