delete files using ssis

  • Please note that Script Tasks and Script Components are different things. Using the terms interchangeably will confuse people who know the difference.

    Script Tasks are used in the Control Flow (and are probably what is needed here).

    Script Components are used only in data flows.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Here is an alternative article you can follow if you would like a different way of doing it with SSIS

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/87652/

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Phil Parkin (7/30/2013)


    Please note that Script Tasks and Script Components are different things. Using the terms interchangeably will confuse people who know the difference.

    Script Tasks are used in the Control Flow (and are probably what is needed here).

    Script Components are used only in data flows.

    Phil, thanks for reminding me how long I've been away from SSIS. :crying:



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • I ended up using Alvin's recommendation and write c# code in the script task.

  • use powershell command in execute process task

    dir D:\Backup\*.* |? {$_.LastWriteTime -lt (get-date).AddDays(-2)} | del

  • Vidhyaraaghav wrote:

    use powershell command in execute process task

    dir D:\Backup\*.* |? {$_.LastWriteTime -lt (get-date).AddDays(-2)} | del

    Haven't tried it but looks great... Welcome aboard!

     

    --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 6 posts - 16 through 20 (of 20 total)

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