sp_update_jobschedule

  • hi everybody

    i tried to schedule a job for an asp page using a sp that i've created.

    in my sp i use sp_update_jobschedule but the result is:

    job schedule is correctly updated but it is not enabled

    if i try from query analyzer work correctly

    can yuo help me?

    this is a part of my sp

    EXEC msdb.dbo.sp_update_jobschedule

      @job_name  = @JobName,

      @name   = @ScheduleName,

      @active_start_date = @Start_date,

      @active_start_time = @Start_time,

      @enabled  = 1

     

    bye

    (yuo are great!!!)

  • have you checked the jobschedule status with

    sp_help_jobschedule ?

  • Hmmmm.  I just did some preliminary tests with sp_update_jobschedule, and it would not change the status of the job either way.  Alternatively, you could access the enabled column directly:

    DECLARE @myJob sysname

    SET @myJob = '<name of job>'

    -- Show job info

    SELECT enabled

         , job_id

         , name

      FROM msdb..sysjobs

     WHERE name = @myJob

    -- Enable job

    UPDATE msdb..sysjobs

       SET enabled = 1

     WHERE name = @myJob

    -- Disable job

    UPDATE msdb..sysjobs

       SET enabled = 0

     WHERE name = @myJob

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

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