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

SSIS File System Task Help

$
0
0

Hi folks,

I have a table called Attachment and it looks like this:

IDFile_Name File_Details
1abc.xlsxabc_20121121_150142.xlsx
2xyz.pdfabc_20121121_150142.pdf
3123.xlsx123_20121121_150142.xlsx

The column File_Name contains the name of the files stored in a source file path. And File_Details stores the same File Name in the format<name>_YYYYMMDD_HHMISS.<extn>. I have an Execute SQL Task that will store the Full ResultSet from the Attachment  table in an object variable. After that, the package should check in the source file path for the files returned from the Exceute SQL Task.

For e.g.: if in the source file path, if there are files with the same name as given in the File_Name column, then it should move all those files to a destination file path. In the destination path, the file names should be having the name as given in File_Details column.

i.e if abc.xlsx, xyz.pdf, 123.xlsx are there in the source file path, they should be moved to a destination file path with the names abc_20121121_150142.xlsx, abc_20121121_150142.pdf, 123_20121121_150142.xlsx respectively.

The approach I have taken is explained below:

1. Execute SQL Task to get the File_Name and File_Details and store in an object variable called varFile

2. A For Each Loop Container (having Foreach ADO Enumerator)

3. A File System Task inside the Foreach Loop Container.

Can I please get some help from you to complete my task?

Thanks

Sharath


Sharath




Viewing all articles
Browse latest Browse all 24688

Trending Articles



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