Sql-server – Load flat file into a predetermined table

csvimportsql server

Scenario

  1. Table created

    enter image description here

  2. Data in flat file loaded to the table but with errors. please advise how to fix it

    (a) 'address' is split to 3 columns causing mismatch between the source and destination

    enter image description here

    (b) 3 Nulls in the 'B_Date' column due to different format. Do I need to massage the raw file before load into the Microsoft SQL or what is the SQL formula?

raw file

enter image description here

enter image description here

Best Answer

Why do you think address is being split into three columns? Based on your screenshot column 5 is being mapped to address and 6 and 7 aren’t being mapped to anything.

Can you please share the full error messages? Also does your file have headers, I presume not based on your screenshot. Try adding headers to the flat file and letting the wizard create the destination table for you.