Scheduling a Job in sql server

  • Hi i have a Job scheduled in sql server, and that job is scheduled to run every friday at 9.00 PM. Now i need to even schedule it to run every last working day of each month. so my question is if the last working day of a month falls on friday, will my job run twice on that day or will it run only once. Please let me know. What can i do in order to make it run only once if it runs twice.

    I appreciate any help

    Thanks

  • Schedule it twice, once for Fris, once for EOM. Be sure the time on the day for EOM is later than the one for Fris. Then add logic to the EOM one that doesn't run the job if it's Fri. Maybe a step before that checks for datepart(wd, getdate()) = Friday. If so, return an error so the job doesn't run. Be sure you end the job on step failures.

  • Thanks for your reply. I have my JOB scheduled in SQL Server agent. Can you pelase explain me as to how can i add that step in that job to fail if the EOM is Friday.

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

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