Click here to Skip to main content
15,914,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to update xml in sqlserver 2005 or later.

Help required I want to update the xml and then display the values.
Posted
Updated 4-Apr-11 0:25am
v2
Comments
Zia Ullah Khan 4-Apr-11 6:55am    
DECLARE @newValue varchar(50)
2 SELECT @newValue = 'NewValue'
3
4 UPDATE [Product]
5 SET ProductXml.modify('replace value of (/Sample/NodeThree/text())[1] with sql:variable("@newValue")')
Zia Ullah Khan 4-Apr-11 6:55am    
i think in this way we can do the xml updation

1 solution

If the data type is XML, then please check the following article. which updates and displays the XML data stored in database:
XML data type tips in SQL Server 2005[^]

Another example:
http://www.15seconds.com/issue/050803.htm[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900