BULK INSERT from CSV does not read last row

末鹿安然 提交于 2019-12-12 04:24:21

问题


I have the following T-SQL statement:

BULK INSERT #TempTable
FROM "C:\csvfile.csv"
WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR ='\n', FIRSTROW = 2, KEEPIDENTITY )

I am test running it on a 3 row csv file, of which the first row contains the headers. So there are 2 data rows.

However, it only reads line 2 and never line 3.

Any idea why?


回答1:


A line break was needed after the last row. Ugh.



来源:https://stackoverflow.com/questions/10317210/bulk-insert-from-csv-does-not-read-last-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!