Wednesday, March 21, 2012

Job NextRunDate using DMO always 0

Hi All,
I'm having a problem where whenever I add a new job (in code) with a
schedule to our server, the NextRunDate and NextRunTime properties are
always 0.
I have tried executing the sp_help_jobschedule stored procedure, but the
values returned are still 0.
I noticed that when i did a refresh on the job object itself when i was
using SQL Server 2000 SP4, the nextRunDate and time were calculated
correctly, however, we are not moving to SP4 and are staying on SP3a, so
that doesn't really help me.
Hope you can help.
Thanks,
BenHi
Just wondering if sp_help_job gives you the correct schedule?
John
"Ben Brearley" wrote:

> Hi All,
> I'm having a problem where whenever I add a new job (in code) with a
> schedule to our server, the NextRunDate and NextRunTime properties are
> always 0.
> I have tried executing the sp_help_jobschedule stored procedure, but the
> values returned are still 0.
> I noticed that when i did a refresh on the job object itself when i was
> using SQL Server 2000 SP4, the nextRunDate and time were calculated
> correctly, however, we are not moving to SP4 and are staying on SP3a, so
> that doesn't really help me.
> Hope you can help.
> Thanks,
> Ben
>
>|||Hi John,
Yes sp_help_job does give me the correct schedule.
I found out that the problem was fixed in SP4, and it involves Jobs not
starting unless they are owned by an admin user.
I tested this with a domain admin account, and the Next run dates and times
appear perfectly.
So until we go to the latest service pack, i guess this problem will be
unresolved, unless we calculate these Dates and times ourselves.
Ben
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:83BE8BBE-FC78-41B0-8B4C-CBF419ADF44C@.microsoft.com...
> Hi
> Just wondering if sp_help_job gives you the correct schedule?
> John
> "Ben Brearley" wrote:
>|||Hi Beni
If sp_help_job shows the correct shedule use profiler to see what it calls
before it runs sp_help_jobschedule or run sp_help_job and discard the result
before running sp_help_jobschedule.
John
"Ben Brearley" wrote:

> Hi John,
> Yes sp_help_job does give me the correct schedule.
> I found out that the problem was fixed in SP4, and it involves Jobs not
> starting unless they are owned by an admin user.
> I tested this with a domain admin account, and the Next run dates and time
s
> appear perfectly.
> So until we go to the latest service pack, i guess this problem will be
> unresolved, unless we calculate these Dates and times ourselves.
> Ben
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:83BE8BBE-FC78-41B0-8B4C-CBF419ADF44C@.microsoft.com...
>
>

No comments:

Post a Comment