• Jeff Moden - Monday, November 20, 2017 4:23 PM

    camaro305hp - Monday, November 20, 2017 3:57 PM

    rwest 44523 - Wednesday, July 19, 2017 8:04 AM

    The best of all worlds:

    use [msdb]

    Declare @weekDay Table
    (
      mask int
    , maskValue varchar(32)
    );
    ................................................................

    Thank you!  This is exactly what I've been looking for.  Extremely useful script.

    Since it doesn't tell you of any failures, cancellations, nor how many times something has executed in, say, the last 24 hours, what will you do with the information that it produces?

    For my purposes of using this script, I'm not interested in those things (I am interested in them, but that's not what I'm using this script for).  I'm using it to do a daily backup of all my jobs/schedules.  In case of catastrophic failure, I can have a quick list of all the jobs/steps/schedules that I can use to quickly get the jobs back up without messing around with the msdb backup.  I do the same thing with logins and linked servers.