October 28, 2008 at 5:29 am
We have a table 'A' and its has a col 'A' with data type xml.
The contents are in xml form and I need to directly update one node in that xml.
update from 'B' Set Name=Lower(Name); -- will update all names in that table to lower case
Same way there is a node 'Name' in the xml which is stored in 'colA' in one statement. We have done in a different way. I need to know can be done the say I have mentioned above in one simple statement?
cheers
Siddarth
October 29, 2008 at 4:48 am
XML is not my strong point, but if you provide more details regarding your data and table structure maybe we cud try.
"Keep Trying"
October 30, 2008 at 4:03 am
I am trying to paste the xml content here but the site is now allowing me to do so.
October 30, 2008 at 4:07 am
Yeah, I tried to give you an example but I also could not past xml content here.
But as a clue, lookup the SQL Server documentation: there are examples how to modify xml data types using XQuery syntax.
October 30, 2008 at 7:14 am
siddartha pal (10/30/2008)
I am trying to paste the xml content here but the site is now allowing me to do so.
Save the XML as a txt file and upload it to the site.
Then we can copy it and use it 🙂
October 30, 2008 at 8:02 am
See if this works
although I don't see the point of LowerCase 1 XML element (either do it in front-end), or might as well LowerCase the entire XML
UPDATE TABLE
SET XMLcolumn.modify(
'replace value of (//WebSRFTemplate/Data/ACCESSAEndSiteID/text()) [1] with "Test"')
WHERE condition
October 31, 2008 at 5:09 pm
I have done in some other way and was looking for something like the same. I will execute the same and check if the same works. Some one told me that you cant modify any xml column the way you can fire update on any other column.
thanks a lot for the same and I will get back to you with the result.
cheers
Siddarth
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply