SQL agent job disabled

  • If a job in SQL agent job list disabled, but the schedule is enabled, will it still run?

    I thought after I disabled the job, the job will not run even in the schedule screen the enabled check box is checked..
    But I see in job activity Monitor it  still show the job failed. and next run will be tomorrow.

    Thanks

  • sqlfriends - Thursday, June 8, 2017 12:16 PM

    If a job in SQL agent job list disabled, but the schedule is enabled, will it still run?

    I thought after I disabled the job, the job will not run even in the schedule screen the enabled check box is checked..
    But I see in job activity Monitor it  still show the job failed. and next run will be tomorrow.

    Thanks

    No it won't run.
    Job activity monitor will show the next run date and time based on the schedule associated with the job but it doesn't mean it will run at that time. If you were to enable the job it would run at that time.

    Sue

  • Schedules are separate objects attached to the job. They need to be enabled to be used, but they are separate from the job.

    Job Schedules: https://docs.microsoft.com/en-us/sql/ssms/agent/create-and-attach-schedules-to-jobs

  • This should be quicker to test than to post?

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • Thanks, I know either of job or schedule is disabled, the job will not run.

    The reason I asked is we have solarwinds monitoring the server, the job ran 2 months ago and failed, then we disabled the job for it does not need to run at this time.
    But solwinds still show a failure in SQL agent job in red flag even the job failed 2 months ago,  I would like to clear that out so that we don' t need to check at this time.

    Thanks

  • IF you dont care about job history for this job that has been disabled 
    THEN
    https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-purge-jobhistory-transact-sql
    sp_purge_jobhistory  { [ @job_name = ] 'job_name' |   | [ @job_id = ] job_id }  [ , [ @oldest_date = ] oldest_date ]

    Catch-all queries done right [/url]
    Gail Shaw's Performance Blog[/url]

  • Thank you, the job history for those failed job had already deleted.

    What I found is:
    Yesterday, I disabled the schedule ( plus previously disabled job), then solarwinds no longer pull that failed job.
    If I only disable job but not disable schedule, they will still show failed jobs.

    So it is fine now.

    Thanks all.

Viewing 7 posts - 1 through 6 (of 6 total)

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