Solved

SQL Server - HTML <BR><BR> corrupting CSV output

Posted on 2013-06-03
4
371 Views
Last Modified: 2013-06-03
I have a table that contains a column nvarchar(max) that contains text that includes <BR><BR> in the value.

When I save query results in CSV or Tab delimited format, the rows become corrupt at the <BR> characters.

What are my options for dealing with this? Is there any way to preserve these HTML characters in the CSV output withoiut corrupting the file?

Thanks in advance.
0
Comment
Question by:bobinorlando
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Assisted Solution

by:gplana
gplana earned 50 total points
ID: 39217536
Apart of the <br> characters, are they any carry return or line feed, i.e. chr(10) or chr(13) characters? If so, just try to remove them.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 50 total points
ID: 39217802
What are my options for dealing with this? Is there any way to preserve these HTML characters in the CSV output withoiut corrupting the file?
<BR> is just text it cannot "corrupt" your file.
0
 
LVL 16

Accepted Solution

by:
DcpKing earned 400 total points
ID: 39217867
Please show a sample piece of the HTML that you find in the table field, and the resulting piece of CSV file. Also, please try showing the text in the table (and in the resulting CSV file) in Hex format (try using this utility if you don't have an editor like UltraEdit) as some characters that you might possibly be getting into your database field do not show when viewed but do have an effect in a CSV or similar file!

Thanks

Mike
0
 
LVL 1

Author Comment

by:bobinorlando
ID: 39217911
Thanks guys!
It was a char(10) LF character that was embedded in the data which was easier to see in the utility. Thanks for the pointer.
0

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

740 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