24 Jan 2013

Querying values in XML field - MS SQL 2008

In MS SQL 2008, you can use these script to query a value from xml column.

Check existence. This returns 1 if there is an element in xml
[column].exist('//element-name') = 1

Get element.

Get value of element. You can define the type of value.


Post a Comment