我正在尝试在我们的 sql 数据库中的一个表中进行批量上传。当我们将数据库放在不同的服务器上时,这个查询之前运行良好,但现在在新服务器上我收到错误。 这是我所拥有的: sql批量导入查询:
BULK
INSERT NewProducts
FROM 'c:\newproducts.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
我收到的错误是:
Msg 4832, Level 16, State 1, Line 1
Bulk load: An unexpected end of file was encountered in the data file.
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)".
感谢您提前提供的任何帮助。
最佳答案
对于遇到此问题并寻求答案的其他人来说,当 CSV 文件中的列数与您要批量插入的表的列数不匹配时,也会发生此错误。
关于sql-server - 批量上传: "unexpected end of file" on new server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5475729/