Posted By

Meander365 on 04/21/10


Tagged

sql search replace


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Search and Replace String in an SQL Server nText Field


 / Published in: SQL
 

URL: http://www.sidesofmarch.com/index.php/archive/2008/02/27/how-to-use-replace-within-ntext-columns-in-sql-server/

  1. UPDATE TABLENAME SET FIELDNAME = cast(REPLACE(cast(FIELDNAME AS nvarchar(max)),'find-this','replace-this') AS ntext)
  2. WHERE Content LIKE '%find-this%'

Report this snippet  

You need to login to post a comment.