Import .CSV to SQL Table
BULK INSERT New_Table FROM 'c:\csvfile.txt' --or a .csv file WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO
![]()
Yes, so gracefully simple…
Just create the table beforehand

BULK INSERT New_Table FROM 'c:\csvfile.txt' --or a .csv file WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO
![]()
Yes, so gracefully simple…
Just create the table beforehand
~ by Francois Wiid on February 19, 2008.
Blog at WordPress.com. Theme: ChaoticSoul by Bryan Veloso.
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
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 )
[...] Import .CSV to SQL Table [...]
20,000 hits « Welcome to the Fallout said this on April 15, 2009 at 11:43 pm |
I’m using the same insert code but FIELDTERMINATOR = ‘”,”‘ however when their is a Null in a column it throws an error. Is there anyway round this?
Thank you