Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • How do you plan to change it back next Sunday? Wouldn't it be cleaner to just let it run every 10 minutes and quit with success if the record is there and it's not Sunday yet? Commented May 29, 2019 at 19:24
  • @AaronBertrand It's more my OCD, I don't want the job history spammed with all the unneeded runs. Commented May 29, 2019 at 19:36
  • Job history for successful runs is easy to keep clean (or only keeping the runs that made it to a certain step, for example). I wrote a starter piece here. I'm also thinking that if the record doesn't appear until Friday or Saturday that your OCD is on the wrong end of the deal. Commented May 29, 2019 at 19:37
  • @AaronBertrand thanks for the link, I'll be looking at that later. Commented May 29, 2019 at 21:35
  • Another idea: Job is executed once. Loop with a WAITFOR DELAY. When the condition is satisfied, exit. Optionally, also exit if it's no longer Sunday. Maybe THROW an error, if you want job history to highlight you didn't get the expected condition in your time window). No schedule modding, no history cleaning. Commented May 30, 2019 at 16:26