Wednesday, March 28, 2012

Job Step

I have a job step that needs to run with a different parameter on Sunday.
The job step is of type Operating System Command. This step kicks of an
executable.
Can you help me with a solution?
Thanks,
ChrisHow about creating a second step that has different parameters. Then create
a second job that runs prior to this job. In this second job, you can check
to see if it is Sunday and then enable appropriate step on first job and
disable the other one (and vice versa).
"csl" <kcl1998@.hotmail.com> wrote in message
news:uCOv4089HHA.3548@.TK2MSFTNGP06.phx.gbl...
>I have a job step that needs to run with a different parameter on Sunday.
> The job step is of type Operating System Command. This step kicks of an
> executable.
> Can you help me with a solution?
> Thanks,
> Chris
>|||Hi,
I do this with three job steps. Job step 2 has the 6 days a week command,
and job step 3 has the sunday command. In job step one I put a statement
that calls RAISERROR('whatever', 16, 1) on Sunday. Then I set up step one to
go to step 2 on success and step 3 on failure. Both steps 2 and 3 quit
reporting success on success and quit reporting failure on failure.
Or, just create two SQL Agent jobs. One runs weekly on Mon-Sat, and the
other runs weekly on Sun.
--
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Dragon" <noSpam_Badill@.hotmail.com> wrote in message
news:uk2aK689HHA.4584@.TK2MSFTNGP03.phx.gbl...
>
> How about creating a second step that has different parameters. Then
> create a second job that runs prior to this job. In this second job, you
> can check to see if it is Sunday and then enable appropriate step on first
> job and disable the other one (and vice versa).
> "csl" <kcl1998@.hotmail.com> wrote in message
> news:uCOv4089HHA.3548@.TK2MSFTNGP06.phx.gbl...
>>I have a job step that needs to run with a different parameter on Sunday.
>> The job step is of type Operating System Command. This step kicks of an
>> executable.
>> Can you help me with a solution?
>> Thanks,
>> Chris
>>
>

No comments:

Post a Comment