Search code examples
visual-studiossisheader

SSIS export data to flat file and omit header from the output


I am creating an SSIS package to query a database and extract the results to a csv file. I'm using Visual Studio 2019. I have set "Header rows to skip:" to 0 - 4. I did the same with data rows in the Preview tab, and nothing changes. I do not see anything the Properties to remove the header. I also tried this link, and it did not help. SSIS Flat File Destination Column Headers. Unchecking the box on this screen immediately gives me this error.

Severity Code Description Project File Line Suppression State Error Validation error. Data Flow Task Flat File Destination [2]: The number of input columns for Flat File Destination. Inputs[Flat File Destination Input] cannot be zero.

What else is there?

enter image description here


Solution

  • The answer is to set header rows to skip to 0 and uncheck the column names in the first data row. To get this to create a file manager with the column headings, I used the following steps:

    1. Delete the flat file destination and file manager, if exists
    2. Add new flat file destination and click new flat file manager
    3. When the dialogue opens, it asks for an existing file. Instead, browse to a path and enter a new file name. Column names in the first data row will not be checked, so click OK and OK. This will populate a flat file without headers.