Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

688 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