SQl server Agent

Hi, I have a SQL server job with 3 schedules, how I can configure the job to ignore schedule 2 and 3 if schedule 1 was successful, schedules kicks off 8,9,10 AM, the job runs on a monthly basis.

more ▼

asked Apr 16, 2010 at 02:12 PM in Default

user-1550 (google) gravatar image

user-1550 (google)
11 2 2 3

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Well, one option that you could try is to set up two steps in the job. The first step would, on success, call the second step, which made calls to sp_update_schedule and disabled those two schedules for that job. Or, reverse it, and have the jobs disabled by default, but if the first step errors, the second step enables the two schedules using the same proc.

more ▼

answered Apr 16, 2010 at 02:35 PM

Grant Fritchey gravatar image

Grant Fritchey ♦♦
103k 19 21 74

Great thanks a lot
Apr 16, 2010 at 03:51 PM user-1550 (google)
most efficient method to perform the task. There are other methods that may be employed, but this is what I would use.
Apr 16, 2010 at 08:48 PM CirqueDeSQLeil
(comments are locked)
10|1200 characters needed characters left

DOh... Pip'd at the finish line !!!

more ▼

answered Apr 16, 2010 at 02:36 PM

sp_lock gravatar image

9.3k 25 28 31

I +1d Grant but I thought I'd +1 you too in sympathy! :)
Apr 16, 2010 at 06:47 PM Matt Whitfield ♦♦
yeah, you get a +1 in sympathy from me too ;)
Apr 18, 2010 at 11:46 AM Fatherjack ♦♦
Ha.. Thanks guys ;-)
Apr 18, 2010 at 01:16 PM sp_lock
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Apr 16, 2010 at 02:12 PM

Seen: 1235 times

Last Updated: Apr 16, 2010 at 06:54 PM