How to prevent SSIS from writing column names to the flat file output?

后端 未结 3 1525
灰色年华
灰色年华 2021-01-14 00:48

I am getting the output in flat file as shown below.

\"Flat

How do I avoid column n

相关标签:
3条回答
  • 2021-01-14 00:59

    If you already have header in the file - you can simply skip the first row. See screenshot from @user756519 answer. Set Header rows to skip to 1

    0 讨论(0)
  • 2021-01-14 01:06

    The best way that I've found to accomplish this is the following:

    1. I create a test output flat file. I populate the .txt file with the result set from the SQL query that will be used in the package. Make sure that the first row of the .txt file contains the column header names.
    2. Create a Flat File Connection. Point it to the text output flat file. Check the "Column names in the first data row" box. This will make sure that the actual column header names will be used/shown, instead of "Column 0", "Column 1", etc. Click "OK" to close the Flat File Connection Manager.
    3. Edit the Flat File Destination item to make sure that the actual column header names are picked up and that the fields are mapped properly between your query and the output columns of your Flat File Connection. Click "OK".
    4. Highlight the Flat File Connection and press "F4" to open the "Properties" window. There, change the "ColumnNamesInFirstDataRow" to "False".

    Now your output flat file will contain data only...no column header row. Yet you can still go to the Flat File Destination item and see the actual column header names being used there.

    0 讨论(0)
  • 2021-01-14 01:14

    Avoiding column names in the flat file output:

    Double-click the Flat File Connection Manager to open the Flat File Connection Manager Editor

    On the Flat File Connection Manager Editor, uncheck the box Column names in the first data row.

    This will prevent flat file connection manager from writing the column names to the flat file output.

    Flat File Connection Manager Editor

    0 讨论(0)
提交回复
热议问题