473,378 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Bulk Insert: Unexpected end-of-file (EOF) encountered...

AB
Hi to all,
I have a problem about a importation of a file *.csv with SQL Server,
through a bulk insert, called in a store procedure that a c# sw calls.
This is the description of the error:
-----
System.Data.SqlClient.SqlException è stata individuata
Message="Bulk Insert: Unexpected end-of-file (EOF) encountered in
data file.\r\nOLE DB provider 'STREAM' reported an error. The provider
did not give any information about the error.\r\nOLE DB error trace
[OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
The provider did not give any information about the error.].\r\nThe
statement has been terminated."
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=16
LineNumber=1
Number=4832
Procedure=""
Server="ets3971"
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlExc eption
exception, Boolean breakConnection)
at
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj)
at
System.Data.SqlClient.SqlCommand.FinishExecuteRead er(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at
System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async)
at
System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result)
at
System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at sarbox.Default.LoadFlux_Click(Object sender, EventArgs e) in
c:\Inetpub\wwwroot\Zarbox2.2\SoxAdmin\Default.aspx .cs:line 1509
---

Th@nks to all

AB@

Apr 17 '07 #1
3 22509
AB@ (b.********@gmail.com) writes:
I have a problem about a importation of a file *.csv with SQL Server,
through a bulk insert, called in a store procedure that a c# sw calls.
This is the description of the error:
-----
System.Data.SqlClient.SqlException è stata individuata
Message="Bulk Insert: Unexpected end-of-file (EOF) encountered in
data file.\r\nOLE DB provider 'STREAM' reported an error. The provider
did not give any information about the error.\r\nOLE DB error trace
[OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
The provider did not give any information about the error.].\r\nThe
statement has been terminated."
Unfortunately, the information you posted is not sufficient to help
you. Could you please post:

1) The BULK INSERT statement.
2) Any format file you are using.
3) A short sample of the data file.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 17 '07 #2
AB
On 17 Apr, 23:40, Erland Sommarskog <esq...@sommarskog.sewrote:
AB@ (b.aharo...@gmail.com) writes:
I have a problem about a importation of a file *.csv with SQL Server,
through a bulk insert, called in a store procedure that a c# sw calls.
This is the description of the error:
-----
System.Data.SqlClient.SqlException è stata individuata
Message="Bulk Insert: Unexpected end-of-file (EOF) encountered in
data file.\r\nOLE DB provider 'STREAM' reported an error. The provider
did not give any information about the error.\r\nOLE DB error trace
[OLE/DB Provider 'STREAM' IRowset::GetNextRows returned 0x80004005:
The provider did not give any information about the error.].\r\nThe
statement has been terminated."

Unfortunately, the information you posted is not sufficient to help
you. Could you please post:

1) The BULK INSERT statement.
2) Any format file you are using.
3) A short sample of the data file.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I have risolve it - thanks

May 2 '07 #3
This looks resolved, but I've experienced this problem before.
Resolution occured in one of three ways:

1) We sometimes get files that are cut off prematurely and a line
will only be a fraction completed. This will fail a bulk-insert.
2) Sometimes an extra carriage return is at the end of the file.
I've seen this fail the bulk-insert with an Unexecpected EOF message.
3) Sometimes I just couldn't figure out the answer and using DTS
instead of bulk insert resolved the problem.

I hope that helps somebody. :D

-Utah

May 2 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Xizor | last post by:
I have the following code: $username_sqlsafe = addslashes($data); $email_sqlsafe = addslashes($data); $name_sqlsafe = addslashes($data); $location_sqlsafe = addslashes($data); $password_md5 =...
1
by: Dianna | last post by:
I have a datafeed coming from another Database which I am populating into a Dataset. I want to take the dataset and insert all the rows into a Sql Table. So far I have an 'insert stored proc' and...
4
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column...
3
by: Mike C# | last post by:
Am looking for an ODBC SQLBulkOperations wrapper for VC++; in particular I need to perform bulk Insert operations. Anyone know where I can find this? Thanks
8
by: Santy | last post by:
Hello All, I am new to DB2, Currently i am using DB2 version 8.02 personal edition on Windows XP Professional. And Facing problem with rowlock in insert query. I have created a sample database...
2
by: nano | last post by:
Does sql server have a way to handle errors in a sproc which would allow one to insert rows, ignoring rows which would create a duplicate key violation? I know if one loops one can handle the error...
19
by: Khafancoder | last post by:
Hi guys, in my db i have these three tables 1.Stores 2.Products 3.Parts their structure is something like : Stores ----Products ----Parts
7
by: girl | last post by:
Hi i have a problem with MS SQL server 2000 and hope to seek for some advise. i have the following samples aa|0|abcdefg| b|0|abcdefg| i used the bulk insert in the query analyser.. BULK...
2
by: Weyus | last post by:
All, Just want to make sure that I understand what's going on here. I have a table with IGNORE_DUP_KEY set on a unique, multi-column index. What I'm seeing is this: 1) When performing a...
2
by: chompy | last post by:
I am trying to dynamically create the errorfile name with the date the error occured. The error occurs at ERRORFILE = @errorfilename Is this possible? Here is the script I have so far... ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.