ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Replace in ntext (eg. exports of Messagent)

Categories: Messagent SQL Server

select cast(replace(cast(xml as nvarchar(max)),'old@mail.be', 'new@mail.be') as ntext) 
from channels
where xml like '%old@mail.be%'

/*
update channels
set xml = cast(replace(cast(xml as nvarchar(max)),'old@mail.be', 'new@mail.be') as ntext)
where xml like '%old@mail.be%'
*/