You are here: Re: BCP import with Blank lines in text file « MsSQL Server « IT news, forums, messages
Re: BCP import with Blank lines in text file

Posted by Erland Sommarskog on 01/05/07 23:28

EricR (erucevice@gmail.com) writes:
> When the text file comes out of my Java application the last line
> record has a carriage return which creates the blank line at the end of
> the file. There are no blank lines between records. Thanks

Ah, I think misunderstood you. So you file looks like this:

Order Number~Company Name~Product~Quantity~ID~User~Date~Site\r\n
Order Number~Company Name~Product~Quantity~ID~User~Date~Site\r\n
Order Number~Company Name~Product~Quantity~ID~User~Date~Site\r\n
Order Number~Company Name~Product~Quantity~ID~User~Date~Site\r\n
\r\n

Since I don't know Java, I need to ask a really stupid question: do
you really need that extra \r\n at the end? Can't you prevent Java
from adding it? Because, it can be quite difficult to get BCP to handle
that file. BCP believes in complete records so to speak.




--
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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация