Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

ForEach Loop to delete all files in folder. Expand / Collapse
Posted Thursday, October 18, 2012 3:38 PM



Group: General Forum Members
Last Login: Tuesday, July 15, 2014 8:32 AM
Points: 188, Visits: 335

I went to the following URL:

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.


Post #1374597
Posted Sunday, October 21, 2012 5:57 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, June 9, 2014 6:15 AM
Points: 79, Visits: 243
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 ||
Post #1375163
Posted Monday, October 22, 2012 1:20 AM



Group: General Forum Members
Last Login: Today @ 9:28 AM
Points: 13,570, Visits: 10,447
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.

How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1375281
Posted Tuesday, October 23, 2012 12:37 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, May 14, 2014 5:30 AM
Points: 880, Visits: 669
pls give any dummy value to that variable..
it is not pass that value to to file system task..
for validation purpose only........
Post #1375850
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse