XML Datatype Method – nodes()
The nodes() method is useful when you want to shred an xml data type instance into relational data means it will be mapped into a new row.
The syntax is
nodes (XQuery) as Table(Column)
The below shows how to display the xml data in relational data in different rows.
SELECT JobHistory.query('.')as nodes
FROM Employee CROSS APPLY JobHistory.nodes('/Job') as MyNodes(a)
The syntax is
nodes (XQuery) as Table(Column)
The below shows how to display the xml data in relational data in different rows.
SELECT JobHistory.query('.')as nodes
FROM Employee CROSS APPLY JobHistory.nodes('/Job') as MyNodes(a)
Comments