Wednesday, April 7, 2010

Current date in SSIS expressions

How to make a file with current date in SSIS? You can build a file name using an expression builder in SSIS. There is a function GetDate() that returns current time (not date) in form of DB_Timestemp SSIS data type. You can extract just date if you cast it using (DT_DBDate) function. You will also need to convert it to string and add static parts of file name to it:

"c:\\backup\\file"
+ (DT_DBSTR 10, 1252)(DT_DBDate)GetDate() + ".txt"

No comments:

Post a Comment