SSIS Package - Looping through folder to check if files exists -
can help:
required: ssis package loop through folder (containing 100 files) , check whether required files (which 5/6) present in folder.
does has code - checking multiple files existence in destination folder
regards
- add foreach loop container control flow
- double click , select collection. on enumerator, select foreach file enumerator
- select folder , type of file
- select return type when file found. options whole filename including extension , path, name , extension or name of file found
- select checkbox if want subfolders
- click on variables option on left , new variable or select existing variable.
at point have each file name on folder. prove it, add script component, double click it, , variable on read variable , click on edit script. make main this:
public void main() { system.windows.forms.messagebox.show(dts.variables["filename"].value.tostring()); dts.taskresult = (int)scriptresults.success; }
now, comparison can several ways. dont know have "required files" list, assuming on database, can add data flow task , inside of send filename db comparisson.
Comments
Post a Comment