I would like to know how I can update a part of the text of an XML node in SQL Server 2005 using xquery
In the following example I would like to replace the word "very" with "excellent"
declare @xml as xml
set @xml = '<root><info>well hello this is a very good example</info></root>'
declare @replacement as varchar(50)
set @replacement = 'excellent'
declare @search as varchar(50)
set @search = 'very'
set @xml.modify('replace value of (/root/info/text())[1]
with replace((/root/info/text())[1],sql:variable("@search"),sql:variable("@replacement"))'
)
select @xml
Any help would be appreciated