Import csv file into existing table where 1st row has sep=,

  • andrewjmdata

    SSC Rookie

    Points: 32

    Hi, I have a csv file that has the value "sep=," in the first row and the header in the second row.

    I can import it as using the flat file wizard however that doesn't allow importing into an existing table.

    The data import task allows importing into an existing tables but i can't figure out which options to change so that it ignores 1st row (with "sep=,"), takes header from second row and then data in following columns.

    Any ideas?

    Thanks

     

    Andrew

  • Phil Parkin

    SSC Guru

    Points: 244807

    I don't use the data import wizard, but if you know how to edit the SSIS package it produces, you will see that there is a property called 'Header rows to skip' on the connection manager for the CSV file. Changing that from 0 to 1 should do it for you.

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
    See https://www.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help/ for details of how to post T-SQL code-related questions.

Viewing 2 posts - 1 through 2 (of 2 total)

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