Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-06-03
4
Medium Priority
?
387 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 200 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 200 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 1600 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

886 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