0

I have one problem with bulk insert. I have about 7 million records in the csv file, when I make the following query, just half of the total records are entered in the table. The Query I use:

BULK INSERT *Table_Name* FROM 'file path'
    WITH
        (
        FIRSTROW = 1, -- csv dont have header
        FIELDTERMINATOR = '0x0a',
        ROWTERMINATOR = '\n',
        ERRORFILE = '*error file path*',
        TABLOCK
        )

Table Creation query:

CREATE TABLE *Table_Name*
(
    ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
    *Column_Name* varchar(50)
);

Where I make a mistake? How to load all records from a csv file (all 7 million)?

Bain-27
  • 49
  • 1
  • 6

0 Answers0