Hi Team,
I've 4 columns in my database table, whereas 10 columns in my .csv file.
I want to upload first 4 columns of .csv file only in db table.
ROWTERMINATOR is '0x0A' and FIELDTERMINATOR IS ','
I've tried through FORMATFILE but failed. Can you guys please help me.
Error Message I got:
Msg 4866, Level 16, State 8, Line 5The bulk load failed. The column is too long in the data file for row 1, column 4. Verify that the field terminator and row terminator are specified correctly.
Msg 7301, Level 16, State 2, Line 5
Cannot obtain the required interface ("IID_IColumnsInfo") from OLE DB provider "BULK" for linked server "(null)".
USE [TestDB]; GO TRUNCATE TABLE dbo.test; BULK INSERT dbo.test FROM 'E:\Dbase\InputFiles\MERCHANT\Report_180919.csv' WITH (FIRSTROW=2, FORMATFILE = 'E:\Dbase\InputFiles\MERCHANT\FormatFile.fmt'); GO
Format File is: