UPDATE and SET w/ CAST (String Replace)

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%'
 
C

Chris2

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top