SQL Server Error: Bulk load data conversion error (type mismatch or invalid character for the specified codepage)

lingers
 
on Jul 29, 2021 06:15 AM
1170 Views

Please help,

I cant bulk insert into sql server

i get this error

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 3, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 4, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 5, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 6, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 7, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 8, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 9, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 10, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 11, column 1 (id).

Msg 4864, Level 16, State 1, Line 1 Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 12, column 1 (id).

Msg 4865, Level 16, State 1, Line 1 Cannot bulk load because the maximum number of errors (10) was exceeded.

Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7330, Level 16, State 2, Line 1 Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

Completion time: 2021-07-29T13:11:59.1997356+01:00

CREATE TABLE [dbo].[docket](
[id] [int] IDENTITY(1,1) NOT NULL,
[docket_no] [nvarchar](max) NOT NULL,
[type] [nvarchar](max) NOT NULL,
[product_code] [nvarchar](max) NOT NULL,
[base_no] [nvarchar](max) NOT NULL,
[description] [nvarchar](max) NOT NULL,
[order_qty] [int] NOT NULL,
[total_qty] [int] NOT NULL,
[date] [nvarchar](32) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


//////////////////////////////////////
Create view [dbo].[docketview] as
SELECT id
,docket_no
,type
,product_code
,base_no
,description
,order_qty
,total_qty FROM docket
GO
/////////////////////////////////////////////////////
BULK INSERT docketview
from 'C:\Users\hp\Desktop\docketk.csv'
with ( FIRSTROW =2,
FIELDTERMINATOR =',',
ROWTERMINATOR='\N',
BATCHSIZE=25000)

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download