Re: Updating XML documents stored within SQL Server
- From: "Joe Fawcett" <joefawcett@xxxxxxxxxxxxxxxx>
- Date: Thu, 17 Apr 2008 13:00:01 -0700
"Crookie74" <crookie74@xxxxxxxxxxx> wrote in message news:0ac3bc26-4883-48c0-bcc3-3dc0690faf65@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have xml documents stored inside sql server. I know how to get backYou need to use the modify method however SQL Server 2005 doesn't directly support dynamic updates. This means that you can set the value to 'Paul' if you know in advance it will be 'Paul' but not if you need to retrieve the value at run time. For that you'll need to use modify with dynamic SQL. See these links and if you are still struggling tell us more.
a piece of data using xquery eg:
select CustomerDocument.query('data(/*:Customer/CustomerInformation/
Name)')
from Customer
where ID = '4747345041'
(This will return Pete)
but i don't know how to change the value. I was expecting something
like:
update Customer
set CustomerDocument.query('data(/*:Customer/CustomerInformation/
Name)') = 'Paul'
where ID = '4747345041'
but this doesn't work. Can someone please help me with the correct
syntax.
Thanks in advance
http://msdn2.microsoft.com/en-us/library/ms190675.aspx
http://www.devnewsgroups.net/group/microsoft.public.sqlserver.xml/topic55693.aspx
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
.
- References:
- Updating XML documents stored within SQL Server
- From: Crookie74
- Updating XML documents stored within SQL Server
- Prev by Date: request for book review
- Next by Date: xquery -- inserting multiple elements
- Previous by thread: Updating XML documents stored within SQL Server
- Next by thread: How to view permissions of existing stored proc ?
- Index(es):
Relevant Pages
|