SQL Server Agent Not Updating Job Next Run Date

  • Hello, I use SQL 2019. I have a job that runs yearly. For some odd reason the date changed on it. Now when I try to set a new date for it under job activity monitor it will just stay on the incorrect date. I just updated the Windows, and restarted it. I also restarted SQL Server Agent. Yet it's still on the same next run date. We're on Windows Server 2019 standard. Here's the info from SSMS:

    SQL Server Management Studio 15.0.18424.0

    Microsoft MSXML 3.0 6.0

    Microsoft .NET Framework 4.0.30319.42000

    How can I get it to see the change? I searched for it and a lot of forums just say to restart SQL Server Agent which I did with no success. Currently it set to run in 26 months yet the next run date states 2-1-24. Any help would be great thanks.

  • Have you tried deleting the schedule and making a new one?

    I've had schedules not behave the way I want (usually after doing in-place upgrades) and deleting the schedule and recreating it fixes the issue.

    Alternately, you say it is set to run every 26 months, what is the START time for the schedule? That is what will be used to determine the next run date.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Here's the info:

    image_2024-01-17_073307719

  • Delete the schedule, click on the save button, reopen the Job, and then set a new schedule. There could be an issue with the Scheduler ID of the Job.

    Thanks,
    Abhinav

  • So that is based on your start date. Jan 1st, 2015 + 26 months is March 1st, 2017. Next run is May 1st, 2019, then July 1st, 2021, then September 1st, 2023, so next run should be August 1st, 2025.

    Since you are seeing 2-1-2024 (Feb 1st I believe), it sounds like things may have gone goofy with the start time. What I would do is adjust the start date to be the date you EXPECT it to run next. So if you expect it to run August 1st, 2025, then set the start date to August 1st, 2025 as it seems to me that SQL or I am doing some odd calculations for every 26 months.

    Also, I am a bit confused why you would call the job "yearly" and state in the OP that it runs yearly when it runs every 26 months. There are only 12 months in a year. But I'm sure you have your reasons.

     

    Disregard the above

    I think the advice by meraki is a better way to go than what I suggested. Remove the schedule and recreate it.

    I am leaving my original post in case anyone cares to read it, but the advice from meraki is a better way to go. I am still a bit confused why you call the job "yearly" when it runs every 26 months though...

    • This reply was modified 4 months ago by  Mr. Brian Gale. Reason: better solution provided by another poster

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Yep deleting the schedule and adding a new one did nada. I probably need to delete the whole job and re add. When I did a new schedule it did give it a new ID, yet the next run date is still the same. We're going to open soon so I'll have to try a new job tomorrow. Is there some kind of cache I need to clear? Old ID was 20. New one is 25, but the name is still the same.

  • With the new job, did you use the same start date? If so, may not hurt to bump the new start date up to the next expected run date.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Nope the old one was back in 2015. The new one was todays date.

  • Are you expecting it to run today? if not, then set the start date to the date you want things to run.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Another question - how many schedules do you have on the job right now? If you have more than 1, it could be that one of the other schedules is what is triggering the run next month.

    Would it be possible to send a screenshot of:

    1- the schedules listed for the job

    2- the next run schedule for the job

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Crap that was it. After changing the start date, then it finally updated to the correct date in the monitor.

    Thanks

  • This was removed by the editor as SPAM

Viewing 12 posts - 1 through 11 (of 11 total)

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