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

“Unable to retrieve the metadata for …” Error while using ASP.NET MVC 3

Building application using ASP.NET MVC and MongoDB

Getting Started with ASP.NET MVC, SignalR KnockoutJS