我需要一些批量插入支持...
表格创建;
CREATE TABLE [dbo].[TestTable] (
[ACARa] varchar(50),
[ACARb] varchar(50),
[ACARc] varchar(50),
[ACARd] float,
[ACARe] varchar(50))
所有列“允许为空”勾选
我想在此表中插入以下数据。
CSV文件:
ACARa;ACARb;ACARc;ACARd;ACARe
"COM IN";"";"";"0.000000000000000";""
"IN (ALL)";"";"";"0.000000000000000";""
使用此查询;
BULK
INSERT TestTable
FROM 'C:\TestFile.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ';',
ROWTERMINATOR = '\n'
)
GO
当我执行它时,我收到此错误;
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 4 (ACARd).
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 4 (ACARd).
我做错了,我找不到。你能测试同样的场景吗?
问候。