SSIS 2008 R2- Schedule Data flow task so that it only runs on Workday 1 - 2 Days

38 views Asked by At

I have a SSIS package in visual studio 2008 which just contains a simple data flow task (ole DB source, flat file destination). However I need to add a constraint so that the task only executes on workday 1 minus 2 days, anyone know if this can be achieved?

No ideas at present, I am expecting the DFT to only execute on WD1- 2 days

1

There are 1 answers

3
Nick.Mc On BEST ANSWER

You can write a SQL statement to work this out.

SELECT 
CASE 
WHEN DATEPART(DAY,DATEADD(DAY,2,GETDATE()))=1 THEN 'Y' 
ELSE 'N' 
END

You run this in an execute SQL task, then capture the output then branch as required

Or you can use an SSIS expression to work it out (then you don't need to connect to the DB)

You do need to consider some logic in case your job fails on a given day. If you run the job a day later, what should you do?

I can add more details to this answer if this appeals to you