locked
How to get the variable value in a flatfile RRS feed

  • Question

  • I have some 2 line string in a variable I wanted to see this value in a flat file.

    Thanks,

    Narthan

    Monday, September 29, 2014 7:43 PM

Answers

  • I want to see the assigned value of the variable in the flat file.

    Hi Narthan,

    I understood your reply like this. You a have "Data Flow Task" inside the DFT you have the "Flat File Destination". You want to add the variable as new column to flat file. If So, Please add "Derived Column Transformation" in between source and destination, and drag and drop the variable inside the Derived Column and name the column. Do need ful changes in destination.

    see image for "Derived Column Transformation"


    --------------- Please mark it as Answer, if you get the solution with this reply. TQ.----------------


    • Edited by Satish Pavuluri Tuesday, September 30, 2014 7:41 AM
    • Proposed as answer by Harry Bal Tuesday, September 30, 2014 7:00 PM
    • Marked as answer by narthan Tuesday, September 30, 2014 7:02 PM
    Tuesday, September 30, 2014 7:40 AM

All replies

  • What I understand is : You need to export data to flat file. In this process, you need to apply some transformation using SSIS variable.

    Go by this tutorial here to learn "Exporting data to a text file using a package".

     

    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

    Monday, September 29, 2014 7:51 PM
  • No, Let me put in other way I have a variable with string datatype and the value assigned to it is 'xyz'

    and I want to see the assigned value of the variable in the flat file.

    Monday, September 29, 2014 8:32 PM
  • I want to see the assigned value of the variable in the flat file.

    Could not understand, what do you mean by this?

    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

    Monday, September 29, 2014 8:55 PM
  • I want to see the assigned value of the variable in the flat file.

    Hi Narthan,

    I understood your reply like this. You a have "Data Flow Task" inside the DFT you have the "Flat File Destination". You want to add the variable as new column to flat file. If So, Please add "Derived Column Transformation" in between source and destination, and drag and drop the variable inside the Derived Column and name the column. Do need ful changes in destination.

    see image for "Derived Column Transformation"


    --------------- Please mark it as Answer, if you get the solution with this reply. TQ.----------------


    • Edited by Satish Pavuluri Tuesday, September 30, 2014 7:41 AM
    • Proposed as answer by Harry Bal Tuesday, September 30, 2014 7:00 PM
    • Marked as answer by narthan Tuesday, September 30, 2014 7:02 PM
    Tuesday, September 30, 2014 7:40 AM
  • Hi Narthan,

    If I understand correctly, you want to use some variables in a Flat File Connection Manager. If in this case, we can use variables in a Property of Flat File Connection Manager. For more details, please refer to the following steps:

    1. Click the Flat File Connection Manager in Connection Manager tab, then navigate to Properties window.
    2. Click “…” next to the Expressions property to open the Property Expressions Editor.
    3. In the Property Expressions Editor dialog box, select the corresponding property at the Property drop-down list.
    4. Click “…” next to the Expressions property to open the Expression Builder, then expand Variables and Parameters folder to select the variable.

    Reference:
    http://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/

    If there are any misunderstanding, please elaborate the issue for further investigation.

    Thanks,
    Katherine Xiong


    Katherine Xiong
    TechNet Community Support

    Tuesday, September 30, 2014 10:28 AM
  • No, Let me put in other way I have a variable with string datatype and the value assigned to it is 'xyz'

    and I want to see the assigned value of the variable in the flat file.


    As Satish, use the derived column component (DCC) to add the variable value to the flat file. You may have to open the destination flat file conn mgr and re do the mapping to bring the varibale value from DCC to the dest flat file

    Thanks, hsbal

    Tuesday, September 30, 2014 7:02 PM