Showing posts with label tags. Show all posts
Showing posts with label tags. Show all posts

Tuesday, March 20, 2012

Replace <br> tag in CRLF

Hi all,

I made a migration operation and when I am looking inside database I can see the <BR> tags.

The question is how to write a query that replace all of this occurances of <BR> inside the colum table, with CLRF which is a new line code.

Thanks in advance.

REPLACE(my_string_field, '<br>', chr(13) + chr(10)) will do the replace in a field...so maybe a query like this would work?

UPDATE MY_TABLE
SET MY_STRING_FIELD = REPLACE(MY_STRING_FIELD, '<br>', chr(13) + chr(10));

give or take|||

We are close but not yet. I needded to change the code so it will work.

The conversion is working but all the characters become question mark like this: "?? ? ?? ?? ?? ?? ???? ? ?? ?"

I tried 2 types of the unicode that one of them should be the one I am using, but still the quotation marks is there...here is the query please help:

UPDATE [E:\WEBSITES\A1\TBH_WEB\APP_DB.MDF].[dbo].[tbh_Comments]
SET
[Body] =REPLACE((CAST([Body]AS varChar(1000)) COLLATE SQL_Latin1_General_CP1_CI_AS),'<br>',char(13) +char(10))

Monday, March 12, 2012

Repeated Elements

Can someone please help? I need the tags sorted by record
(which contains many levels of elements), not by a group
of <LName>elements.
Using
http://localhost/Customer/views/Empl...xsd/Employee/L
Name='King' I get the following:
<LName>Buchanan</LName><LName>Callahan</LName><LName>Davoli
o</LName><LName>Dodsworth</LName><LName>Fuller</LName><LNam
e>King</LName><LName>Leverling</LName><LName>Peacock</LName
><LName>Suyama</LName>
--^
I am not sure what the problem is. Do you want a single wrapper element
around? Do you want a different result? How would that look like?
Thanks
Michael
"TO" <anonymous@.discussions.microsoft.com> wrote in message
news:2e48a01c46a9d$fe009fc0$a301280a@.phx.gbl...
> Can someone please help? I need the tags sorted by record
> (which contains many levels of elements), not by a group
> of <LName>elements.
> Using
> http://localhost/Customer/views/Empl...xsd/Employee/L
> Name='King' I get the following:
> <LName>Buchanan</LName><LName>Callahan</LName><LName>Davoli
> o</LName><LName>Dodsworth</LName><LName>Fuller</LName><LNam
> e>King</LName><LName>Leverling</LName><LName>Peacock</LName
> --^
>