Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Replace in NTEXT field

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-02-01 : 14:21:22
I have a bunch of <br> tags I need to encode in a ntext field, I tried a simple replace :

blah = replace(blah,'<br>','<br>')

but it didn't work on the ntext!

ideas?

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-02-01 : 22:17:00
Your are replacing
<br> with <br> that keeps the string exactly the same.

Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2003-02-01 : 23:08:12
Sorry I mean

'<br>','<br>'

the point was its not working....errors out.

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-02-01 : 23:18:58
quote:

but it didn't work on the ntext!



How would you like to encode it?

If you're trying to modify an ntext column
look in BOL under

Modifying ntext, text or image Values.


Also any time when dealing with unicode strings you
should use N in front to specify that it's a unicode string

N'<br>'



Edited by - ValterBorges on 02/01/2003 23:24:48
Go to Top of Page
   

- Advertisement -