Jobschedule without next run date/time

  • Hi everyone,

    I'm writing a procedure which checks if all my database are covered by a backup job and if not creates a new job. Everything works fine, but it seems that the schedules created through sp_add_job_schedule somehow don't work. The schedule is created and enabled, the startdate is there and everything.

    But in the job overview in EM, the column Next Run Date says "(Date and Time not available)" and the job just won't run.  I tried it by using the example from BOL, but the same result. It looks like I have to supply the columns next_run_date and next_run_time, but they are no parameters in sp_add_job_schedules. Has anybody else experienced this behaviour ? We run  SQL2K SP4 in case you wonder.

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • In Enterprise Manager, go to Jobs. Find the job and right click on it. Go to the Schedule tab. Is Enabled checked? If not, check it. Then look at when the job is scheduled to run. Is it a one time only, or is it reoccuring? If it is reoccuring, click on Change. Is there an End Date set?

    -SQLBill

  • Bill,

    I checked before. All the jobs and the schedules are enabled. And it happens to all schedules I create through sp_add_job_schedule. And no, the jobs don't have a end date other than the default value.

    The funny thing though is that if I open the job in EM and just look at the schedule without changing anything, after closing the properties window the job suddenly shows a next run date.

    But of course the idea of writing the stored procedure was that I won't have to go through EM.

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • Hello guys,

    I think I solved it. The reason why my jobs there not scheduled properly was because I didn't define a jobserver. Even though EM showed the job as a local server job when I tried to execute the job through sp_start_job I received an error that no jobserver was defined. So I adjusted my procedure to add the jobserver and now it works fine.

    Markus

    [font="Verdana"]Markus Bohse[/font]

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

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