Replace strings in Text column

Answered Replace strings in Text column

  • Monday, August 22, 2005 11:05 AM
     
     
    Hi!

    I would like to replace some strings (for instance 'mystring1' with 'mystring2') in a column of datatype Text. Replace function does not work with Text columns. The following works:

    update mytable set myfield=replace(convert(varchar(8000), myfield),'mystring1','mystring2')

    but it truncates data the exceed the 8000 bytes. Ofcourse I have some rows containing more than 8000 bytes in that field, that's why it is set a Text.

    Any ideas?

All Replies