Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Job Steps

Author  Topic 

poser
Posting Yak Master

124 Posts

Posted - 2011-10-24 : 11:29:10
I have a job with 3 steps but on Fridays I want it to skip step 2.
Can I do this in one job or do I need to create another job to do this?
Thanks for any help
R/P

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 11:38:05
you can do it in one job. check as the 3 step add a if step like

IF DATENAME(dw,GETDATE()) = 'Friday'
SELECT 1
ELSE
<your actual query>

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

poser
Posting Yak Master

124 Posts

Posted - 2011-10-24 : 11:55:41
I'm sorry...I do not understand where to put it...
Should this go before step 2 occurs?
Thank you, p
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 11:59:59
quote:
Originally posted by poser

I'm sorry...I do not understand where to put it...
Should this go before step 2 occurs?
Thank you, p


nope that should go inside the current script you've given for step 3

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

poser
Posting Yak Master

124 Posts

Posted - 2011-10-24 : 12:28:07
I'm sorry I'm really new to all this..
I want it to skip step 1 on fridays and start at step 2
Not sure where to put in script:

IF DATENAME(dw,GETDATE()) = 'Friday'
SELECT 1
ELSE
<your actual query>

Step 1
SSIS Package (checks to see if a txt file is there)

Step 2
SSIS Package (Import File)

Step 3
SSIS Package (Copy table)

r/p
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 12:53:46
oh is 1st step an ssis package?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

poser
Posting Yak Master

124 Posts

Posted - 2011-10-24 : 12:57:02
All are SSIS packages.
Sorry I should have clarified better...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-24 : 13:49:56
cant do it within job. only way is to tweak the package to add a conditional check in beginning to see if its friday and in that case just return without executing any other steps.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

poser
Posting Yak Master

124 Posts

Posted - 2011-10-25 : 09:13:28
Thank you for your help and your patience.
r/P
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-26 : 01:02:32
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -