Solved

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

Posted on 2013-06-03
4
356 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
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 Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now