Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8772467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:02:23+00:00 2026-06-13T18:02:23+00:00

i am doing a bulk insert: DECLARE @row_terminator CHAR; SET @row_terminator = CHAR(10); —

  • 0

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 INSERT accn_errors
   FROM ''F:\FullUnzipped\accn_errors_201205080105.txt''
   WITH 
      (
        firstrow=2,
FIELDTERMINATOR = ''|''  ,
ROWS_PER_BATCH=10000
   ,ROWTERMINATOR='''+@row_terminator+'''
   )'
exec sp_executesql @stmt;

and am getting the following error:

Msg 4832, Level 16, State 1, Line 2
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 2
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 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

is there a way to know on which ROW this error occurred?

i am able to import 10,000,000 rows without a problem and error occurs after that

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:02:24+00:00Added an answer on June 13, 2026 at 6:02 pm

    To locate the troublesome row use the errorfile specifier.

    BULK INSERT myData
    FROM 'C:\...\...\myData.csv'
    WITH (
    FIELDTERMINATOR = ',',
    ROWTERMINATOR = '\n',
    ERRORFILE = 'C:\...\...\myRubbishData.log' 
    );
    

    myRubbishData.log will have the offending rows and a companion file
    myRubbishData.log.txt will give you row numbers and offsets into the file.

    Companion file example:

    Row 3 File Offset 152 ErrorFile Offset 0 - HRESULT 0x80004005
    Row 5 File Offset 268 ErrorFile Offset 60 - HRESULT 0x80004005
    Row 7 File Offset 384 ErrorFile Offset 120 - HRESULT 0x80004005
    Row 10 File Offset 600 ErrorFile Offset 180 - HRESULT 0x80004005
    Row 12 File Offset 827 ErrorFile Offset 301 - HRESULT 0x80004005
    Row 13 File Offset 942 ErrorFile Offset 416 - HRESULT 0x80004005
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a bulk insert of records into a database from a log
I'm doing a bulk insert from a fixed width text file using INSERT INTO
I am doing: BULK INSERT CSVTest FROM 'c:\csvtest.txt' WITH (FIELDTERMINATOR = ',', ROWTERMINATOR =
I'm doing a bulk insert of a CSV file into SQL Server 2005, using
I’m trying to bulk insert data to SQL server express database. When doing bcp
I'm doing a bulk insert but before inserting into the actual table I need
I am doing a bulk insert: // Get the data into the DataTable //dtData
I am doing a BULK INSERT into sqlserver and it is not inserting UTF-8
Hello Everyone Iam trying to bulk insert data from .dat file(unloaded from sybase) in
There are existing options for doing bulk insert into a single table with EF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.