|
Posted by Erland Sommarskog on 01/04/07 22:20
EricR (erucevice@gmail.com) writes:
> I am trying to bcp import a text file into a SQL Server 2000 database.
> The text file is coming out of a java application where order
> information is written to the text file. Each record is on it's own
> row, so the last item in each record has a new line character at the
> end of it to create the next row. This works well in creating the file
> however bcp does not like to import this text file with the extra blank
> line at the end. If I change the new line character to the beginning of
> the records then there is a blank line at the top of the text file,
> which bcp also does not like. Does anyone have any suggestions for me
> to get around this issue?
For BCP questions it helps if you post the table definition, any format
file you use and a sample of the data file (if possible as an attachment).
If I understand this correctly, your file has a blank line beetween
every line with tect on:
231;yadayada;some more yadayada
2345;tuttelitugård;straight on!
Specifying the row terminator as \r\n\r\n or \n\n if the file has
Unix format.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|