The error tells you exactly what the problem is. FieldName
is a column of type text
, which doesn't work with the REPLACE
function. Try casting the first param as VARCHAR(MAX)
first, and it should work. IE:
UPDATE TableName
SET FieldName = REPLACE(CAST(FieldName AS VARCHAR(MAX)), 'SearchFor', 'ReplaceWith');