XML Datatype Method – Value()

This performs an XQuery against the XML and returns a value of SQL type. This method returns a scalar value.

The syntax is

value (XQuery, SQLType)

The below shows how to return the company name value of a varchar datatype

SELECT JobHistory.value('(/Job/CompanyName)[1]','varchar(100)') FROM Employee

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