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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help with bulk insert

Status
Not open for further replies.

pandatime

Programmer
Jan 29, 2010
92
AU
Hi,

I have a flat file separated by pipes, sample below:

1 asdf|asdf|
2 asdf|asdf|
3 asdf|asdf|
4

The row numbers are NOT in the file. However, when I view "line numbers" in textpad, that's what it shows. There is an extra line "4", but no data on it. That's where my bulk import is failing:

Msg 4832, Level 16, State 1, Line 2
Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

I am using a format file. How do I handle this junk row at the very end?

Thank you!!


 
Resolved:

8 SQLCHAR 0 255 "|\n" 8 lastcol ""

I added "\n" to the field "|" terminator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top