Search and Replace String in an SQL Server nText Field


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. UPDATE TABLENAME SET FIELDNAME = CAST(REPLACE(CAST(FIELDNAME AS nvarchar(MAX)),'find-this','replace-this') AS ntext)
  2. WHERE Content LIKE '%find-this%'

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.