I need to convert a flat file to DB using MS SSIS. I need a way to look into a particular folder to fetch the (only) flat file, filename is of the format ‘FileName-CCYYMMDD.txt’.
Please help me if there is way to add a file from the folder OR Get a file name of the format ‘Filename-CCYYMMDD.txt’ where is CCYYMMDD is the current date or maybe CurrentDate -1 according to requirements.
Any code examples or screenshots will be highly appreciated!
To get the connection dynamically, you need to use expression on the ConnectionString property of the flat file
Example, to get ‘D:\CC080226.txt’, you can use the below expression.
‘D:\CC’
+ RIGHT((DT_WSTR,4)YEAR(GETDATE()),2) + (DT_WSTR,2)MONTH(GETDATE()) + (DT_WSTR,2)DAY(GETDATE()) + ‘.TXT’