0

Brief Architecture

My SSIS package is generating dynamic excel files through Data flow. The file name format is "XYZ_Year_Month_Day_Hour_Minutes.xlsx". So I am using variable with expression which uses getDate() to generate above mentioned format.

Problem

I am writing file, using variable name generated through getDate(). Example: "XYZ_2014-8-1_03_30". In control flow I want to access same file in File System task to copy it to FTP. But by time the variable changes its value to "XYZ_2014-8-1_03_32", so unable to locate file.

I tried with System::StartTime, but it stays same throughout package execution and all files get same name.

Is there any way we can store DateTime in a variable & it won't change further?

  • 1
    Is there a loop? Otherwise, I don't understand why the StartTime doesn't work. It's value is assigned when the package starts. Your file name is XYZ_YYYY_M_D_HH_MM? – billinkc Aug 2 '14 at 13:52
1

You could use a script task to set the variable property:

Dts.Variables["uVarDateStamp"].Value = DateTime.Date;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.