How to import a CSV file into SQL which is missing a column name?

  • Hi,

    I'm trying to import a CSV file using SSIS into SQL table. The problem is that one of the columns in the source file does not have header. So, when I preview data using Import/Export wizard , I see the column which is without header shows up under another column and the value looks like this: (David","Spencer)

    ERROR MSG:

    The preview sample contains embedded text qualifiers ("). The flat file parser does not support embedding text qualifiers in data. Parsing columns that contain data with text qualifiers will fail at run time.

    Can anyone guide me how to resolve this?

    Thanks.

    ________________________________________________________________
    "The greatest ignorance is being proud of your learning"

  • Can you confirm that if you fix up the header in the source file, everything runs OK?

    If so, can you post some actual data - just the first couple of rows.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks for replying Phil,

    Yes, fixing the header returns success. I have used Script task to modify the file and then import it into SQL which solves the problem.

    Actually, I was looking for a simple solution within SSIS but it looked like using a script is the only way.

    Good Day !

    ________________________________________________________________
    "The greatest ignorance is being proud of your learning"

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

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