Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bulk copy - error

Status
Not open for further replies.

piti

Technical User
Joined
Apr 12, 2001
Messages
627
Location
SK
i'm trying to insert data from a text file using the bcp utility
this is my command:
bcp MyDatabase.dbo.MyTbl in c:\Mssql7\files\inputdata.txt -T -fc:\Mssql7\files\bcp.fmt -ec:\Mssql7\files\inputlog.err

and i'm receiving this error:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL ServerDriver]Unexpected EOF encountered in BCP data-file

0 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.): total 17916

any idea what's wrong?
 

How have you defined the row terminator in the format file? It may not match the actual row terminator. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
so here's my bcp.fmt file:

7.0
9
1 SQLCHAR 0 255 " " 1 Col1
2 SQLCHAR 0 4000 " " 2 Col2
3 SQLCHAR 0 4000 " [" 3 Col3
4 SQLCHAR 0 4000 "] \"" 4 Col4
5 SQLCHAR 0 4000 "\" " 5 Col5
6 SQLCHAR 0 4000 " " 6 Col6
7 SQLCHAR 0 4000 " \"" 7 Col7
8 SQLCHAR 0 4000 "\" \"" 8 Col8
9 SQLCHAR 0 4000 "\"\n" 9 Col9

both \n and \r\n are not working
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top