Hi all,
I realised a little while ago that I had a SQL Server Agent job running even though the associated schedule was disabled. In the history for the job it listed the message as:
The job succeeded. The Job was invoked by Schedule 231 (30 min schedule).
I didn't want to remove the job, so I deleted the schedule, and checked sysschedules and sysjobschedules and Schedule_ID 231 was then no longer there (it had been before removing the schedule). No other schedules existed in the sysjobschedules table
for that job.
Mysteriously, the job continues to run, and each time the history lists Schedule 231. I've tried a profiler trace and can't work out how SQL Server Agent knows which job to run and where it gets the information for that message. It feels like
it has cached the schedules. Out of curiosity does anyone have any idea why this might be happening or seen this before? I haven't yet restarted the SQL Server Agent, but that is likely to be my next step.
It is SQL Server 2005 SP1, so it's very possible it's just a quirk that existed in an old version.
It's not an urgent problem, but I've been working with SQL Server for a long time and never seen this before so would be interested if there's anything I can learn from it. (Obviously I could delete the job, so I'm sure I can fix the issue.)
Many thanks to anyone who offers help or ideas!