Wednesday, March 21, 2012

Import CSV file into SQL Server


Create a table schema and specify the name in Bulk Insert command

BULK
INSERT Table_Name
FROM 'C:\temp\sample_file.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO

1 comment:

  1. Easy way to di it

    http://sqlcopy.blogspot.in/2012/07/bulk-sql-to-sql-sql-to-csv-csv-to-sql.html

    ReplyDelete