SQL Server Tip: Bulk load a csv file

SQL Server Tip: Bulk load a csv file

Create your table in SQL 2000 or 2005. The table’s columns must match the .csv (comma separated value) columns. Then, from Query Analyzer, execute the following command:

— Load contents of the csv file into the table.

Bulk
Insert YourTable
From ‘C:\YourDataFile.csv’
With (FieldTerminator = ‘,’, RowTerminator =’\N’)
Go

Posted by