Help in script task

  • Hi,

    I have an SSIS package with file system task. That package has script task. It will check in the backup server for the .bak files with getdate(-1). Whenever the script task fail, the package also fail. Here they hardcoded the backup directory in the variables.

    Now, we change the backups into three different drives, I need to keep the same logic. If the backup are with getdate(-1), then script task should success then file system task will execute and move the .bak files but before that, I need to check all three folders and see where the .bak files has getdate(-1) then it has to move that files.

    How to implement this logic in script task?

  • I guess you could loop over your 3 drives in the .NET code.

    Maybe encapsulate the code of the previous solution in a function and use the folder location as a parameter to this function.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I have to ask... why are you trying to do this to begin with? What is it that you're actually trying to do with the .BAK files?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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