Import .CSV to SQL Table

BULK INSERT New_Table
FROM 'c:\csvfile.txt'  --or a .csv file
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO

8-O
Yes, so gracefully simple…

Just create the table beforehand :-)

~ by Francois Wiid on February 19, 2008.

3 Responses to “Import .CSV to SQL Table”

  1. OMW i am so going to kill you for this. Been searching for a way to do something like this and just kept on hitting dead ends.

    Gratis

  2. Hello Readers,

    Please go to following link :

    http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/

    It has explained the same concept in detail.

    Regards,
    Pinal Dave ( http://www.SQLAuthority.com )

  3. [...] Import .CSV to SQL Table [...]

Leave a Reply