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)

Comments

Popular posts from this blog

Jesus - God Thinks of you.

ASP.NET 4.0 Feature - URL Routing

Tips on JQuery Intellisense in VS 2008