Monday, 10 May 2010

SSIS Package Suffixing Date


SQL Server 2005 SSIS package Export to CSV with date Suffix. The default evaluation of SSIS expression puts DD-M-yyyy eg: 01/5/2010 instead of 01/05/2010. This causes issue when you are trying to import CSV into SQL Server especially when you are not controlling the file date format.

Simple way to change is using Expressions with format Specified below

"F:\\test" + (DT_WSTR, 20) DAY( getdate() ) + RIGHT("0" + (DT_WSTR, 20) datepart("mm", getdate() ),2) + (DT_WSTR, 4) YEAR( getdate() ) +".csv"

No comments:

Post a Comment