Solved

BCP Unexpected EOF encountered

Posted on 2009-06-30
4
2,551 Views
Last Modified: 2012-05-07
Hello Experts

I am having troubles with a BCP program. I am trying to upload a CSV file but I keep on getting an error message. Please see the code and error message below. I have also included the FMT file.

Please help.
COMMAND TO PROCESS
bcp tblTemp in "test.csv" -T -f"test.fmt"
 
MESSAGE ON SCREEN
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][SQL Native Client]Unexpected EOF encountered in BCP data-file
 
0 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total     : 16
 
FORMAT FILE
9.0
3
1       SQLINT        0       4       ";"     1     ID                        ""
2       SQLCHAR       2       1024    ";"     2     Name                      SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR       2       1024    ";\n"   3     Desc                      SQL_Latin1_General_CP1_CI_AS
 
FILE THAT I AM UPLOADING
1;a;b;

Open in new window

0
Comment
Question by:Quai_Gon_Jin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24748192
http://blogs.dotnetnerds.com/steve/archive/2005/10/17/25156.aspx

is ID an identity column?  Try turning that off and then inserting.
0
 

Author Comment

by:Quai_Gon_Jin
ID: 24748346
Sorry. No. ID is not an entity column. I am pretty sure that the problem has something to do with the fact that the delimiter is a semi colon and the row terminator is a new line \n
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24748505
http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/4b794e09-ceae-4a3d-8920-fd52dc55cce0

Can you use BCP to export your data (eg: insert temporary in table) then find the correct format as text?
0
 

Accepted Solution

by:
Quai_Gon_Jin earned 0 total points
ID: 24748679
I tried that. When I do then I get a semi binary and semi text table. I am very confident that the problem is with the row seperator. In a binary hex editor it looks like 0A which I am assuming should be /n. However I am sure that the row terminator is not being read correctly as a LN
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MSSQL Query for Selecting the SUM of a Specific Group 2 33
TSQL remove duplicates from different columns 14 50
SQL query 45 31
T-SQL Query 9 30
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question