SSIS expressions
HI All, I found this expression in one of the existing SSIS package in our company. The following expression is used in Derived Column transformation editor to modify the date. Can anyone tell me what does this mean? (CREATED_TM comes from another table.) LEN(CREATED_TM) >= 17 ? (DT_DBTIMESTAMP)(SUBSTRING(CREATED_TM,1,4) + "-" + SUBSTRING(CREATED_TM,5,2) + "-" + SUBSTRING(CREATED_TM,7,2) + SUBSTRING(CREATED_TM,9,9)) : (DT_DBTIMESTAMP)NULL(DT_DBTIMESTAMP) Thanks shamen
October 29th, 2010 6:00pm

Hi shamen, it is trying to convert CREATED_TM to SQL date i think to format as YYYY-MM-DD hh:mm:ss or YYYY-DD-MM hh:mm:ss (probably trying to change month and day positions. eg. if CREATED_TM is 2010-31-12 SQL needs 2010-12-31) smth like: if lenght of CREATED_TM is greater than 17 take first 4 chars of CREATED_TM concatenate with "-", later take following 2 chars and concatenate with "-" and later take following 2 chars again concatenate with "-" and finally take the rest and cast all to DB timestamp. Regards OnurBI and ERP Senior Consultant @ Nexum Bogazici If it is, Please dont forget to mark as answered or at least vote as helpful if the post helps you in any ways.
Free Windows Admin Tool Kit Click here and download it now
October 29th, 2010 8:05pm

Thanks Onur..so its using date field called CREATED_TM but not the systemtime ? What I want to use is actual run time of the package but not the CREATED_TM. If length of CREATED_TM <17, does it use systemtime (or oterhwise DT DBTIMESTAMP)? Thanks againshamen
November 1st, 2010 11:20am

Hi Shamen, If i understand it right, you want to use runtime instead of Created_TM. If so, delete everything in the expression and just use (DT_DBTIMESTAMP) @[System::StartTime] Regards OnurBI and ERP Senior Consultant @ Nexum Bogazici If it is, Please dont forget to mark as answered or at least vote as helpful if the post helps you in any ways.
Free Windows Admin Tool Kit Click here and download it now
November 1st, 2010 11:59am

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

Other recent topics Other recent topics