enabled job vs enabled schedule

  • Hi all, a really stupid newbie question.

    Say you created a new job.  This job is schedule to run everyone 1 hour.  Now I don't want it to run every 1 hour but disable the job (don't want to delete it just yet).  In the job properties, I unchecked the 'enabled' tick box.  So now the job is disabled, but I didn't disabled the schedule itself (the one that runs every 1 hour), will that still cause the job to run even though I disabled it?

    thx

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • No, the agent won't run a disabled job.

  • ninja, thanks for the response.

    does that apply to all jobs because the job that's in question is a merged replication job.  personally I know he setup the replication job incorrectly and is claiming that even though the job is disabled, the scheduled portion will still cause the job to run.

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • I can't confirm this and I have no place to test so I'll let others handle this one.

     

    But as far as I know for a job to run, it must be enabled.  So just disabling it should be enough (unless something reenables it automatically)... but again I can't test this.

  • I'll confirm that Remi is correct.  If a job, replication jobs included, is disabled, it won't run on schedule.

    Greg

    Greg

  • thanks, that's what I thought except this idiot co-worker keeps whinning about how the scheduled portion of the job will still run even if the job itself is disabled.

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • Prove him wrong :

    Create a new job.

    SET it to run in 1 min.

    and use the net send notify after completion.

    Disable the job and see how it does not run.

     

    Good luck.

  • I did this morning, he's still debating it but I'm not responding to any of his emails.

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • Then I suggest you tell him to prove you wrong.  Otherwise you can send him the link to this thread and start doing some more productive work!

  • "thanks, that's what I thought except this idiot co-worker keeps whinning about how the scheduled portion of the job will still run even if the job itself is disabled."

    I think your co-worker is refering to the fact that your schedule for the job is still runned by the SQL Agent (and I tend to agree with) BUT it won t run the job itself.

    BOL

    sp_add_jobschedule

    [ @enabled = ] enabled

    Indicates the current status of the schedule. enabled is tinyint, with a default of 1 (enabled). If 0, the schedule is not enabled. When the schedule is disabled, the job will not be run.

    sp_add_job

    [ @enabled = ] enabled

    Indicates the status of the added job. enabled is tinyint, with a default of 1 (enabled). If 0, the job is not enabled and does not run according to its schedule; however, it can be run manually.


    Kindest Regards,

    Vasc

  • and you can edit your post to take "the jerk" out of it... but you can't edit where it was quoted

    Thank-you,
    David Russell
    Any Cloud, Any Database, Oracle since 1982

  • lol, yeah, I'm gonna send him the BOL info for schedule and job.

    -----------------------------
    www.cbtr.net
    .: SQL Backup Admin Tool[/url] :.

  • The reason schedules can be disabled separately is so that you can have more than 1 schedule and disable a single schedule without disabling the job. Suppose I need to do log backups every hour during the busy season and every 4 hours during the slow season. I would create a single job with 2 separate schedules and disable the schedule I don't want to run at that time. Then at season change, I would switch them.

    If he still doesn't understand, explain it like it's a car engine and the schedules are pistons. If the pistons are still in working order, but the engine is turned off, the pistons don't keep pumping.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

  • Where are the Darwin awards when you need them!!!

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • my two cents please.

    whatever is the status of the schedule, as long as the job is disabled, there is no activitiy that goes on in the SQL Server.

    I did some experiments, specifically with the SQL Profiler.

    just re-iterating everything you guys are saying, just with one more proof.

    thankz

    jambu

     

Viewing 15 posts - 1 through 15 (of 21 total)

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