Feeds:
Posts
Comments

Posts Tagged ‘multiple file types for each loop container’


1.  Create a new variable FullPath of
string data type to hold file name.

 

2. Drag a new “Foreach File Enumerator“task
in BIDS.

 

3. Click on “Foreach File Enumerator
and go to Collection tab and browse your source folder and leave *.* for
files

 

4. Go to Variable Mappings tab now and map
variable FullPath like below

 

5. Drag one “Execute SQL Task” and “File
System task
” inside “ForeachFile Enumerator“container.


6. First execute SQL task is just dummy so that we can apply Precedence
constraint


7. After connecting both execute SQL task, apply Precedence constraint like
below

 

UPPER(SUBSTRING(@[FullPath],FINDSTRING(@[FullPath],”.”,1)+1,LEN(@[FullPath])))==”CSV”
||UPPER(SUBSTRING(@[FullPath],FINDSTRING(@[FullPath],”.”,1)+1,LEN(@[FullPath])))==”DOCX”

 

8. I have used above to identify all files in C:\Test
Folder with “csv” and “docx” extension and move to a different folder.

 

Above can be modified to include more or
different file types

Read Full Post »

%d bloggers like this: