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

  1. add foreach loop container control flow
  2. double click , select collection. on enumerator, select foreach file enumerator
  3. select folder , type of file
  4. select return type when file found. options whole filename including extension , path, name , extension or name of file found
  5. select checkbox if want subfolders
  6. 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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -