Friday, September 17, 2010

Bulk insert in sql server

--create table

CREATE
TABLE CSVTest(ID INT,FirstName VARCHAR(40),LastName VARCHAR(40),BirthDate
SMALLDATETIME)
--bulk insert

BULK
INSERT
CSVTestFROM 'C:\test.txt'WITH(FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')
select * from CSVTest

No comments:

Post a Comment