Solved

BCP load from text file.

Posted on 1998-04-23
3
427 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

770 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