Friday, January 21, 2011

SqlServer: A simple stop-watch for performance monitioring

Declare @Stopwatch datetime
Set @Stopwatch=GetDate()

Do something here

Print DateDiff(ms, @Stopwatch, GetDate()); -- display the elapsed time in milliseconds
Set @Stopwatch = GetDate() -- reset the stop watch

No comments: