UPDATE: A new version of this stored procedure is available. Please check it out here.
I have modified isp_ALTER_INDEX, which is the stored procedure that I use to defragment/rebuild indexes in SQL Server 2005. The changes include two bug fixes and one feature request.
The first bug fix was reported by Fedor Baydarov. He found that @lobData was not being re-initialized to zero after a LOB data type was encountered. This meant that the rest of the indexes to be processed were being done offline even if the online option was available. D’oh!
The second bug fix is that it didn’t check for...
I was going through my scripts today and found one that I’d like to share. This SQL Server script will display job history. The benefit of this script over displaying it from the GUI is that you get to see the job durations quickly. /div>/td>/tbody>/form>/html>]]> select job_name, run_datetime, run_duration
select job_name, run_datetime,
SUBSTRING(run_duration, 1, 2) + ':' + SUBSTRING(run_duration, 3, 2) + ':' +
SUBSTRING(run_duration, 5, 2) AS run_duration