Exporting To Excel, No Column Headers

  • Hi folks

    Is it possible to export data to a blank excel file? When creating an excel destination, the transformation requires mappings to column headers. I simply want to tell the package to export the data to cell locations that I set in the Openrowset i.e. Sheet1$A1:A8, but unless there are column headers it won't work.

    In a test excel file I create 2 column headers, in the same column on different rows e.g

    A

    1 Header1

    2 xxxxxx

    3

    4 Header2

    5 xxxxxx

    However, I want to drop data into column B and C etc. Do I have to create column headers? It doesn't seem to be possible without them.

  • In the connection string you can indicate that there is no header line.

    Set HDR=YES to HDR=NO.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I have it set to NO but it makes no difference

  • mitzyturbo (10/4/2013)


    I have it set to NO but it makes no difference

    You still have to map columns. SSIS needs fixed metadata.

    If you have no header, the column names should be something like F1, F2, F3, ...

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • That's right Koen, the only mapping available in the metadata is F1, nothing that actually references the actual names of the headers that are in the file itself. I'm guessing its by design but I find it strange that it needs a header when the header value isn't in the column transformation GUI. But I guess that's the way that it works.

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

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