• The one bit in my script that people might find useful in the one from the article is the conversion from the silly* integers to real dates.

    The below is actually what you will see in the profiler as EM/SSMS views a job:

    CAST(CAST(run_date AS VARCHAR(8)) + ' ' + STUFF(STUFF(RIGHT('000000' + CAST(run_time AS VARCHAR(6)),6),3,0,':'),6,0,':') AS datetime) AS RunDate

    *OK, so there is the very sensible reason that the way it is stored is very small.

    [font="Arial"]_______________________________________________________
    Change is inevitable... Except from a vending machine.[/font]