February 5, 2009 at 8:24 am
Hello,
I can't seem to reconcile this and can't find a clear explanation on it.
I have a Job set up with a Recurring schedule.
When both Job and its Schedule are Enabled, the Job will run normally.
When Job is Enabled but Schedule isn't, the Job will not run.
When Job is Disabled but the Schedule is Enabled, the Job runs.
I don't get how the Job can be Disabled yet still run when its Schedule is Enabled.
What is the purpose then of Enabling a Job is the Schedule is what controls if it runs or not?
Thanks!
February 5, 2009 at 8:50 am
phrankbooth (2/5/2009)
Hello,I can't seem to reconcile this and can't find a clear explanation on it.
I have a Job set up with a Recurring schedule.
When both Job and its Schedule are Enabled, the Job will run normally.
When Job is Enabled but Schedule isn't, the Job will not run.
When Job is Disabled but the Schedule is Enabled, the Job runs.
I don't get how the Job can be Disabled yet still run when its Schedule is Enabled.
What is the purpose then of Enabling a Job is the Schedule is what controls if it runs or not?
Thanks!
".. When Job is Disabled but the Schedule is Enabled, the Job runs.."
Sounds wrong .... Are you sure about that ??
February 5, 2009 at 9:01 am
I'm absolutely sure about it. I ran a Trace on it.
February 5, 2009 at 9:46 am
I've never encountered that. It shows disabled in the GUI ? Does the "Last Run" get updated afterwards ?
If you look at the "enabled" field in msdb..sysjobs, what do you see ?
February 5, 2009 at 12:10 pm
GUI and DB settings are as expected.
I have done manual runs atkleast 10 times and same results, Schedule must be Disabled to stop Job.
April 20, 2010 at 9:42 am
I'm having the same issue, job disabled, schedule enabled, job runs.
(I'm running sql 2008 sp1)
My jobs were created via a maintenance plan, were yours too?
April 20, 2010 at 10:03 am
Try restarting sql server agent service after disabling the job...seems to work for me.
April 20, 2010 at 10:09 am
Are you disabling the job via the GUI or code? If code, please show the code.
April 20, 2010 at 10:27 am
GUI
April 20, 2010 at 11:36 am
You can generate the code. Open the job, uncheck the "enabled" button, then "Script to new window"
I can't replicate that in 2005. Tried a "regular" job and a maint plan job. Don't recall it ever happening either.
You could query these tables for that specific job and see what the enabled values are:
sysjobs
sysjobschedules
sysschedules
April 20, 2010 at 12:47 pm
I just tried to reproduce the issue as well and couldn't do it.
This DID occur on my production box this morning though.
April 20, 2010 at 1:14 pm
The reason I was asking is i had a similar problem when I would failover our mirror databases. The code that was enabling/disabling the database specific jobs wasn't "working". Where the jobs were being disabled, they kept working and where the were being enabled they would run.
I had to modify my code to use the sp_update_job stored procedure in the msdb database. Turns out that SQL Server Agent caches the information and this stored procedure forces a notification to SQL Server Agent.
April 20, 2010 at 1:57 pm
Sounds like the lesson for the day is to use sp_update_job to enable / disable and to avoid the GUI
April 20, 2010 at 2:18 pm
Not really. When I used the GUI to enable/disable the jobs, it cleared up the problem. I am pretty sure that the GUI uses the stored proc. You would need to run a trace to be sure.
April 21, 2010 at 5:19 pm
Few months ago we decided not to have a schedule enabled in disabled jobs to avoid unwanted runs, like described above
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy