How to add "DTL" to each record for flatfile destination in ssis

  • Hi,

    I have requirement where i need to add "DTL" to each record to a flatfile destination in SSIS.

    the out put should look like

    "DTL", "1", "FirstName", "LastName"

    "DTL", "2", "FirstName", "LastName"

    "DTL", "3", "FirstName", "LastName"

    Thanks in advance

  • Use a Derived Column Transformation

    😎

  • HI Eirikur,

    Thank you so much for your quick help,

    when i tried to concatenate with first column i am not getting expected format using derived column.

    could you please explain me in detail.

    the output structure should be in

    "HDR", "Date:<YYYYMMDD>", "Time: <HH:MM:SS>"

    "ID", "FirstName", "LastName"

    "DTL", "1", "FirstName", "LastName"

    "DTL", "2", "FirstName", "LastName"

    "DTL", "3", "FirstName", "LastName"

    "TLR", "Date:<YYYYMMDD>", "Time: <HH:MM:SS>" "Row Count: 3"

    I am able to produce Header and Trailer along with DateTime and Record count but not able to get DTL in detailed rows.

    Thank you

  • A derived column is generated by an expression. An expression can evaluate to a constant, such as 'DTL'. No concatenation is used, or needed.

  • Hi SoHelpMeCodd,

    Thank you for your help, its working for me,

    i have one more problem in Header of the output file,

    when i open output file in excel the header is displaying as expected HDR but the date and time are displayed within quotes "YYYYMMDD" , "HHMMSS"

    actual out put from csv should be

    HDR YYYYMMDD HHMMSS

    and when it is opened within notepad++ it should be

    "HDR", "YYYYMMDD", "HHMMSS"

    is there any setting that i need to configure in properties of DFT, i am using expression in DFT properties to get header.

    Thanks in advance

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

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