Why do I get this error from my query?
Msg 8116, Level 16, State 1, Line 3
Argument data type text is invalid for argument 1 of replace function.
Query:
UPDATE
tableName
SET
fieldName = REPLACE (fieldName, '<', '<')
WHERE
id = 100
Try this:
UPDATE tableName
SET fieldName = REPLACE (CONVERT(VARCHAR(MAX), fieldName), '<', '<')
WHERE id = 100
this will work for you
UPDATE yourTableName
SET
fieldName = REPLACE (CONVERT(VARCHAR(MAX), fieldName), '<', '<')
WHERE id = 100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With