From: Mr. Magic on
I have an XML field in a table and want to update values in the XML.

Can somebody point me to where updating a field in XML is actually
understandable?

TIA - Jeff.


From: Michael Coles on
"Mr. Magic" <Mufasa(a)NoWhere.Com> wrote in message
news:ePwVdoR0KHA.3584(a)TK2MSFTNGP06.phx.gbl...
>I have an XML field in a table and want to update values in the XML.
>
> Can somebody point me to where updating a field in XML is actually
> understandable?


In what way are you trying to update it? I mean the standard UPDATE
statement does the trick pretty easily if your update is a wholesale
replacement:

UPDATE My_Table
SET My_XML_Column = @My_XML_Variable;

etc.

If you're trying to update individual nodes within the XML stored in the
column without doing a wholesale replacement it gets a little more
complicated since you need to use XML DML, which requires knowledge of
XQuery paths. If that's the case then try Googling XML DML. If you can
share more specific information about your problem you'll probably get a
better answer.

--
Thanks

Michael Coles
SQL Server MVP
Author, "Expert SQL Server 2008 Encryption"
(http://www.apress.com/book/view/1430224649)
----------------