ForEach Loop to delete all files in folder.

  • Hi...

    I went to the following URL:

    http://consultingblogs.emc.com/jamiethomson/archive/2008/04/17/ssis-deleting-a-group-of-files.aspx

    for some help on how to configure a For each loop to delete all the txt files in a folder. I did everything it said (I think) and the annoying little red X doesn't go away. It says : Variable "USER::DeleteFileName" is used as a source or destination and is Empty:

    Obviously, I've missed something. I created the Variable in the ForEach Loop and was able to find it in the File System Task Editor. I've pointed the ForEach Loop Container to the folder in question and give a file mask of *.txt. Not sure what else I'm missing.

    Any hints would be great.

    Thanks

    Crusty.

  • What is the data type and scope of the variable?

    I would suggest you to check the value of the variable before applying File System task? What values are assigning into the variable?

    Vikash Kumar Singh || www.singhvikash.in

  • My guess is the variable DeleteFileName is currently empty and the File System Task can't handle that.

    Try giving the variable a dummy value and see if that helps.

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

  • pls give any dummy value to that variable..

    it is not pass that value to to file system task..

    for validation purpose only........

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

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