TSQL: How can I update the value of an xml tag with the value of an xml tag from another related tab

Posted by halfjust on Stack Overflow See other posts from Stack Overflow or by halfjust
Published on 2010-06-16T03:40:09Z Indexed on 2010/06/16 3:42 UTC
Read the original article Hit count: 197

Filed under:
|
|
|
|

Hello,
How can I update the value of an xml tag with the value of an xml tag from another related table?

something like this:

UPDATE v2
 SET
 [xml].modify ('replace value of (//TAG1/text())[1] 
                with "CAST(v1.[xml].query(''//TAG2'') AS NVARCHAR(MAX))"')
FROM 
 table2 v2, 
 table1 v1 
WHERE
 v2.id = v1.id

Thanks

© Stack Overflow or respective owner

Related posts about Xml

Related posts about tsql