Skip to content

BULK

CREATE TABLE Prices (
ItemID INT,
Price INT
)
BULK INSERT Prices
FROM 'c:\data\prices.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
(3 row(s) affected)

In this example, a table Prices with columns ItemID and Price is firstly created. The BULK INSERT statement is then utilized to import data, specified in a text file (prices.txt), into the Prices table. The FIELDTERMINATOR and ROWTERMINATOR options define the delimiters separating fields and rows in the source data. The output simply notifies that three rows have been inserted into the Prices table using the BULK INSERT operation.