I would like to replace the text of a column in a table
I tried out:
select replace([article], '<p> </p>', '') from Articles
update Articles
set article = replace(article, '<p> </p>', '')
where article like '<p> </p>'
or
UPDATE [AJA].[dbo].[Articles]
SET [article] = ' '
WHERE [article] = '<p> </p>'
GO
and everytime it comes out with the error:
argument 1 not valid in replace
What's wrong with it?
Thanks for your help
SELECT * FROM sys.messages WHERE text LIKE '%argument%not valid in%'article?<p> </p>(you're missing the wildcard characters on your like statement); the third one sets the article body equal to a space where article matches<p> </p>exactly.textdatatype the full error message should tell you the problem at least on 2008Argument data type text is invalid for argument 1 of replace function.