Solved

BCP load from text file.

Posted on 1998-04-23
3
426 Views
Last Modified: 2008-02-01
When I attempt to load data from an ascii text file to
a predefined table I get the following error:
DB-LIBRARY error:
Unexpected EOF encountered in BCP data-file.
Could someone provide advice, specific instructions, or
point me to a good BCP reference guide from which I could
resolve this?  
book  
0
Comment
Question by:vd
  • 2
3 Comments
 
LVL 7

Expert Comment

by:spiridonov
ID: 1088878
Most likely the problem is in your format file. Try manualy inserting a 'dummy' record into your table and then bcp it OUT without format file parameter. It will prompt you for format information for each field. Use the delimiters you are using in your text file and save the information in a new format file. You can then use this format file to bcp IN. Don't forget , that the last field delimiter should be "\r\n" if your records are on separate lines.
0
 

Author Comment

by:vd
ID: 1088879
This is an excellent response! It works. Thanks
0
 
LVL 7

Accepted Solution

by:
spiridonov earned 100 total points
ID: 1088880
Don't forget to grade.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
check the deletion of SQL job on who delete/disable it 12 29
TSQL previous 5 26
Sql Join Problem 2 33
Help Extract Specific in SQL 8 27
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
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.
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.

864 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now