UPDATE and SET w/ CAST (String Replace)

  • Thread starter Thread starter Daniel Reardon
  • Start date Start date
D

Daniel Reardon

I have a text field column in SQL 2005 that contains HTML code. I
would like to update certain references in this HTML code throughout,
but am having problems. I know that I can't do a string replace with
the text data type, which is why I would like to cast it as
nvarchar(max). Any help would be appreciated. Thanks.

UPDATE HTML
SET (Cast(HTMLData as nvarchar(max)) =
REPLACE(HTMLData,'detail.cfm','detail.do')
WHERE HTMLData like '%detail.cfm%'
 
Daniel Reardon said:
I have a text field column in SQL 2005 that contains HTML code. I
would like to update certain references in this HTML code throughout,
but am having problems. I know that I can't do a string replace with
the text data type, which is why I would like to cast it as
nvarchar(max). Any help would be appreciated. Thanks.

UPDATE HTML
SET (Cast(HTMLData as nvarchar(max)) =
REPLACE(HTMLData,'detail.cfm','detail.do')
WHERE HTMLData like '%detail.cfm%'

Daniel Reardon,

I recommend reposting your question over in microsoft.public.sqlserver.programming.


Sincerely,

Chris O.
 
Back
Top