tags:

views:

120

answers:

2

I can easily select all comments from XML by

select @XML.query('comment()')

but can't find how to delete them. Is there appropriate syntax for @XML.modify('delete ...')?

+1  A: 
set @XML.modify('delete comment()')
select @XML

Here it is.

Alsin
A: 

Maybe this article provides you the solution Improving XML Update Performance with SQL Server 2005

UPDATE Store SET Demographics.modify('delete //newnode') WHERE CustomerID = @custid
freggel