how to use sp_help_jobschedule to return all job schedule

  • How to use this store procedure to list all sql job schedule

  • sp_help_jobschedule returns the schedule for just one job. You'd have to query the table sysjobschedules yourself to get this information out.

  • Okay, I will query that table. Thanks

    Any road map to learn all these type of tables and system procedures.

  • USE MSDB

    DECLARE @jobname VARCHAR(150)

    DECLARE @string VARCHAR(250)

    DECLARE job_cursor CURSOR

    FOR SELECT DISTINCT name

    FROM dbo.sysjobs

    OPEN job_cursor

    FETCH NEXT FROM job_cursor INTO @jobname

    WHILE @@fetch_status = 0

    BEGIN

    SET @string = 'sp_help_jobschedule @job_name = [' + @jobname + ']'

    EXEC (@string)

    --PRINT (@string)

    FETCH NEXT FROM job_cursor INTO @jobname

    END

    DEALLOCATE job_cursor

    "Got no time for the jibba jabba!"
    -B.A. Baracus

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply