Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 rename file

Author  Topic 

nord
Posting Yak Master

126 Posts

Posted - 2013-12-02 : 15:43:59
Hi,
I have ssis transfer files from one dirrectory to another.
I would like to vadd to name file date format yyyymmddhhmmss,how I can do it use ssis
Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-03 : 00:27:59
You can use File System Task for this.
Add a variable to generate the filename. Make EvaluateAsExpression property true for it. Keep expression as


REPLACE(REPLACE(REPLACE(SUBSTRING((DT_WSTR,30) (DT_DBTIMESTAMP) GETDATE(),1,19),":","")," ",""),"-","")


then in file system task for rename file choose destination connection as from variable and map it to variable created above.



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

nord
Posting Yak Master

126 Posts

Posted - 2013-12-03 : 11:44:29
Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-04 : 00:22:20
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -