I have a table where ID
is integer
and XML
is XML
data type.
ID XML
----------------------
1 <Form1>...</Form1>
2 <Form1>...</Form1>
3 <Form2>...</Form2>
4 <Form3>...</Form3>
How do I get the result below?
ID XML
-------------
1 Form1
2 Form1
3 Form2
4 Form3
To compute the square root of a number, use the SQRT() function. This function takes a number as its argument and returns the square root.
Database nodes are storage nodes that connect to databases and perform different operations on them, such as update, insert, delete, and select. Each type of Database requires different configuration information.
Use the local-name()
function
select ID, XML.value('local-name(/*[1])','varchar(100)')
from yourtable
Try this
DECLARE @xml as xml
SET @xml = '<Form1>...</Form1>'
SELECT Nodes.Name.query('local-name(.)') FROM @xml.nodes('//*') As Nodes(Name)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With