How to extract filename along with date and time stamp in ssis
Where exactly do you have an issue? You know the exact length of the full filename, so it should be easy to extract the date portion and the time portion. Just use Substring and convert them to the appropriate datatypes.MCTS, MCITP - Please mark posts as answered where appropriate.
May 23rd, 2012 1:49am

HI, I receive input source files every day and i need to load those files into my db. My input file is in this format sample_yyyymmdd_hhmmss.csv. I receive only one per day, where the filename is same for all the files, where date and time stamp varies . So for this purpose i have taken few varibales to get the filename dynamically, and used the following expression to get the filename along with date . This was the exprssion i have used "sample_" + RIGHT("0" + (DT_STR,4,1252)DATEPART("yyyy", (DT_DATE)@[User::p_varAsOfDate]), 4) + RIGHT("0" + (DT_STR, 2, 1252)DATEPART("dd", (DT_DATE)@[User::p_varAsOfDate]), 2) + (DT_STR, 2, 1252)DATEPART("mm", (DT_DATE)@[User::p_varAsOfDate]) +"_" +".CSV" this expression yeilds result sample_2012145_.CSV Now i need to extract time stamp also along with date. For example my input files are as 1. sample_2012145_160244.csv 2.sample_2012155_120533.csv 3.sample_2012165_220944.csv
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 1:05am

Where exactly do you have an issue? You know the exact length of the full filename, so it should be easy to extract the date portion and the time portion. Just use Substring and convert them to the appropriate datatypes.MCTS, MCITP - Please mark posts as answered where appropriate.
May 27th, 2012 1:50am

hi please check below link. you can help you. http://consultingblogs.emc.com/jamiethomson/archive/2007/02/07/SSIS-Nugget_3A00_-Construct-a-timestamp-value.aspxindu
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 3:14am

you can use DT_DBTime to gettime.Regards, nishantcomp2512 Please mark posts as answered where appropriate
May 27th, 2012 7:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics