SSIS 2015 - what is the best way to create ssis task to delete only *.csv files from remote directory

  • SSIS 2015 - what is the best way to create ssis task to delete only *.csv files from remote directory. I thought to use system file task with delete file content. But I cannot able to give *.csv variable. Please advise asap.

  • saptek9 - Friday, May 18, 2018 4:15 PM

    SSIS 2015 - what is the best way to create ssis task to delete only *.csv files from remote directory. I thought to use system file task with delete file content. But I cannot able to give *.csv variable. Please advise asap.

    The easiest way is to use a Script Task. Your C# would look something like this (untested):

    foreach (string f in Directory.EnumerateFiles(remoteDirectory,"*.csv"))
    {  File.Delete(f);}

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • thank you

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

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