XML Datatype Method – exist()

The exist() method returns a bit as follows

1, this means the XQuery expression in a query returns a result which is at least a xml node.

0, this means it’s a empty result

NULL, this means that it was executed against a NULL value.

The Syntax is

exist (XQuery)

The below shows how to check if the JobID 1 exists

SELECT JobHistory.exist('/Job[@JobID=1]') 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