Skip to content
Advertisement

Use bcp to import csv file to sql 2005 or 2008

I have a csv file and i need to import it to a table in sql 2005 or 2008. The column names and count in the csv are different from the table column names and count. The csv is splitted by a ‘;’ .

Example

CSV FILEcontents:

SQL Person Table

Advertisement

Answer

I’d create a temporary table, bulk insert the lot, select into the new table what you need and drop the temporary table.

Something like

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement