info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



SSIS Create Archive Folder based on current system date & time
by BF (Principal Consultant; Architecture; Engineering)
2015-10-15







Solution:


Create package variables called ArchivePath and ArchiveFullPath:

ArchivePath will have it's value property set to: \\srv-app01\apps\Input Files Archive\

ArchiveFullPath will have it's properties set to:

EvaluateAsExpression - set this to True

Expression - set this to:
@[User::ArchivePath]+(DT_WSTR,4)YEAR(GETDATE()) + "_"+ RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2) + "_"+ RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2) + "_"+ RIGHT("0" + (DT_WSTR,2)DATEPART("hh", GETDATE()), 2) + RIGHT("0" + (DT_WSTR,2)DATEPART("mi", GETDATE()), 2)



Configure File System Task to use the ArchiveFullPath package variable

Image #1: