Determine ROW that caused “unexpected end of file” error in BULK INSERT?

后端 未结 11 1970
闹比i
闹比i 2020-12-16 10:18

i am doing a bulk insert:

DECLARE @row_terminator CHAR;
SET @row_terminator = CHAR(10); -- or char(10)

DECLARE @stmt NVARCHAR(2000);
SET @stmt = \'
  BULK I         


        
11条回答
  •  天命终不由人
    2020-12-16 10:46

    Fun, fun, fun. I haven't found a good way to debug these problems, so I use brute force. That is, the FirstRow and LastRow options are very useful.

    Start with LastRow = 2 and keep trying. Load the results into a throw-away table, that you can readily truncate.

    And, you should also keep in mind that the first row could be causing you problems as well.

提交回复
热议问题