Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

One critical requirement with For Each Loop container and File System Task - Please help!!!!

$
0
0
Hi,

This is one of the critical requirement given by my client.

   Assume there are 3 Files are available in a folder. They are 

a)file_july10.txt, 
b)File_july11.txt and 
c)File_july12.txt.

My package has to do the following

1) For each loop the the folder and all the file_*.txt files should be loaded into the table(data will be appended in the table).
2) Then all the three files should be archived.
3) Incase, next week , if they put 3 files in the shared path
    The files may be 
    a)File_july12.txt,
    b)File_July13.txt and 
    c)File_July15.txt.
  
 Please note - this File_july12.txt  is the same file we loaded  and archived during the last load, but this week it has come again)
   
4) So, this time , i should load the  File_July13.txt and File_July15.txt files, because they are new files and then i have to archive it.
But the File_July12.txt - I just need to delete it without loading, because we loaded it last time.


I am ok with loading and archiving the files (1 & 2 steps). But, i am not able to do the next ie - if the already loaded file (might be loaded last week, or last month), i have to delete it without loading. 

This is somehting like a case statement - if (file name is already there) - send it to File System Task for deletion. If not, send it to a DFT for loading and then archive.

I have lot of questions like
Where to store the loaded files name? How to compare the file name loaded this time to previous loaded file ? and then how to pass the file name to the File System Task ?

Can you please help me to do this -  I don't know much about Script task - it would be great if you help me with all the other tasks!


Thanks
Revathy
   


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>