SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server Job Scheduling


SQL Server Job Scheduling

Author
Message
peterhe
peterhe
SSCertifiable
SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)SSCertifiable (5.8K reputation)

Group: General Forum Members
Points: 5838 Visits: 453
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/phe/sqlserverjobscheduling.asp



MattieNH
MattieNH
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4873 Visits: 901

Very interesting article. Is the only way to create multiple schedules for the same job through code, or can you do it through the Enterprise Manager interface?

Mattie





Greg Charles
Greg Charles
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22687 Visits: 6054

You can add multiple schedules for a job in Enterprise Manager. Open the the job properties, click on the Schedules tab, and click on the New Schedule button. As you define each schedule, save it by clicking OK. Be sure that all the schedules are enabled.

Greg



Greg
MattieNH
MattieNH
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4873 Visits: 901
When I clicked on the this script hyperlink (for running a job more often than every minute), I got the following message:

Articles with tags Administering, sqlserverjobscheduling, 2288, Job_30sec.sql
Search for any content tagged Administering & sqlserverjobscheduling & 2288 & Job_30sec.sql

Sorry, nothing found for this search


Not that putting it in one of those multi-line text boxes would have helped; they don't have vertical scroll bars in my browser.

Mattie



Jim McCoy-259251
Jim McCoy-259251
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 262
Very interesting. I have had my share of scheduling challenges like running a job every second Thursday and still haven't come up with a good non-kludgy way of running a job based on receipt of a file to process which would arrive at a pre-determined time ( which may or may not arrive at exactly that time) but the output of the process is also very time dependant.
Larry Aue
Larry Aue
Mr or Mrs. 500
Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)Mr or Mrs. 500 (501 reputation)

Group: General Forum Members
Points: 501 Visits: 668
Start it to run when you expect it and have it run every minute until it finds the file. Sure, it runs often, but ends up doing very little. When it finds the file, you can reschedule the job for the next scheduled time to look for the file as the last step.



Rasool Omidakhsh
Rasool Omidakhsh
Old Hand
Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)

Group: General Forum Members
Points: 325 Visits: 24
Ok we can add multiple schedule to a job. But can we do conditional schedule? Can we for example have a schedule for everyday except the last Thursday of the month? In general how do you handel conditions we may have in SQL Agent?
Jim McCoy-259251
Jim McCoy-259251
Old Hand
Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)Old Hand (343 reputation)

Group: General Forum Members
Points: 343 Visits: 262
Yep, that's my kludge code all right
Philippe Cand
Philippe Cand
Mr or Mrs. 500
Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)

Group: General Forum Members
Points: 538 Visits: 294
Rasool Omidakhsh (11/16/2007)
Ok we can add multiple schedule to a job. But can we do conditional schedule? Can we for example have a schedule for everyday except the last Thursday of the month? In general how do you handle conditions we may have in SQL Agent?


Not sure if there is anyway to do this in SQL Agent however what you can do is to use a job step that runs a ssis package where you have a script that will either fail or succeed the package based on any condition you want. Then you handle the job step success or failure to either exit the job reporting success or branch to some or next step.
Philippe

BI Guy
Rasool Omidakhsh
Rasool Omidakhsh
Old Hand
Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)Old Hand (325 reputation)

Group: General Forum Members
Points: 325 Visits: 24
Thanks Philippe. However the question was if we can handel condition for schedule. For example lets say I have a Job that runs 4 SSIS packages that loads my data mart (I call it dm_Job). I have to run this dm_job everyday. I have another job that runs 20 SSIS packages that loads the whole data warehose (I call it dw_job). I have to run this job on every second thursday. I have to start both these jobs at 00:45 AM. Here is what the issue; if today is the thursday that I am loading the data warehouse I should not run the data mart job because it is part of the dw job. So I need to know if I can have conditions(exceptions) in the schedule.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search