Link to home
Start Free TrialLog in
Avatar of jonathanemerson
jonathanemerson

asked on

Microsoft SQL Server Bulk Insert

I am trying to do a bulk insert and SQL server database table. The code i am using is as follows.

BULK INSERT dbo.UKGeocodes
FROM 'D:\postcodes.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO

I know this insert works as i am using it for another process, and the Field and Row Terminators also have the correct values assigned to them for the file i am trying to insert.

The CSV file is very large with 1.9 million rows so i cannot open it up fully in Microsoft Excel and make changes to the file as the size is beyond the Excel Row limit.

These are the errors that i am getting;
Msg 4866, Level 16, State 8, Line 3
The bulk load failed. The column is too long in the data file for row 1, column 13. Verify that the field terminator and row terminator are specified correctly.
Msg 7301, Level 16, State 2, Line 3
Cannot obtain the required interface ("IID_IColumnsInfo") from OLE DB provider "BULK" for linked server "(null)".

Thanks
ASKER CERTIFIED SOLUTION
Avatar of x-men
x-men
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial