move and load tasks in ssis

  • HI

    I have excel destination file.what i am looking here is that

    I want to create a different files(EXcel) each time by adding a unique identifier to the file name,

    Any help ?

  • Add a File system task and use it to rename the file via a variable.

    -------------------------------------------------------------------------
    Normal chaos will be resumed as soon as possible. :crazy:

  • If you want to create dynamic file names in excel the best way is to click on properties of the Excel Connection manager then select expressions and then select ExcelFilePath property and use a Variable to dymanically create the file name

  • Hi,

    You can add a File System Task at the end of the flow.

    Create 2 different variables for Source & Destination file.

    Like for Destination excel file you can set the property EvaluateAsExpression = TRUE and expression = @[DirName] + "\\" + @[ExcelFileName] + "_" + (DT_WSTR,4)DatePart("yyyy", GetDate()) + "-" + RIGHT("0" + (DT_WSTR,2)DatePart("mm", GetDate()), 2) + "-" + RIGHT("0" + (DT_WSTR,2)DatePart("dd", GetDate()), 2) + "_" + RIGHT("0" + (DT_WSTR,2)DatePart("hh", GetDate()), 2) + "-" + RIGHT("0" + (DT_WSTR,2)DatePart("mi", GetDate()), 2) + ".xls"

    This expression will create a new file each time with this kind of suffix: <FILENAME>_YYYY-MM-DD_HH-MM, example XXXX_2009-12-01_13-03.xls

    Set the Destination & Source Variable and Operation as "Copy file".

    and you are done 🙂

    ~Manoj

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply