September 1, 2010 at 11:49 am
Hi,
I am trying to move the processed file to the archived folder with timestamp attached using SSIS . i have used a for each loop container and within it a file system task for moving the file . But is not able to adda timestamp to the file while moving .
I am using Excel connection manager to loop through different files in a folder.
Thanks
September 1, 2010 at 12:02 pm
could you be more specific? do you want to add time stamp to the name ?
September 1, 2010 at 12:05 pm
Yes, to the name of the file while moving to the archive folder
September 1, 2010 at 12:21 pm
You'll have to use an expression for the destination filename. That expression should concatenate the timestamp with the original filename.
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
September 1, 2010 at 12:46 pm
Yes , you have to use expressions and this can also be done using script
following is an example for Expression, which attaches date to the name
"MP_CCRET"+
Right((DT_WSTR, 4)year(getdate()) ,2)
+ ( len((DT_WSTR, 2) Month(getdate()) )< 2 ? "0" +(DT_WSTR, 2) Month(getdate()) : (DT_WSTR, 2) Month(getdate()))
+
( len((DT_WSTR, 2) day(getdate()) )< 2 ? "0" +(DT_WSTR, 2) day(getdate()) : (DT_WSTR, 2) day(getdate()))
rt("ss",getdate()) : (DT_WSTR, 2) datepart("ss",getdate()))
+".txt"
September 1, 2010 at 12:48 pm
What is "MP_CCRET" ? IS this added to the File System task ? Please elaborate.
September 1, 2010 at 1:03 pm
It is just an example in my case..date will be appeneded along with the text i mentioned in double quotes
September 3, 2010 at 7:37 am
Once the file is processed...as in your case...have a Script task or FST(File Rename)
have a variable(s) and follow the approach Alvin has mentioned
Raunak J
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply