Using datepart as Precendence Constraint

  • I would like to use a precendence constraint with a DATEPART expression to determine which stored proc to run in my SSIS package. If it's a Monday, I want one proc to run. If it's any other day, I want the others to run. I know that in SSMS I can evaluate the day of the week by doing select datepart(weekday,getdate()). If it =2, then I know it's Monday & I want to run one particular proc. I just can't figure out the syntax to put in the expression box of the precedence constraint editor. Can anyone help?

  • I think all you need for the Monday case in the expression box would be:

    DATEPART("dw", GETDATE()) == 2

    [font="Arial Narrow"]bc[/font]

  • Oops, and for the other days of week path:

    DATEPART("dw", GETDATE()) != 2

    [font="Arial Narrow"]bc[/font]

  • That worked perfectly. Thank you so much!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply