Xquery get value from attribute

Posted by Steven on Stack Overflow See other posts from Stack Overflow or by Steven
Published on 2010-05-26T10:27:52Z Indexed on 2010/05/26 10:31 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hi,

I have some xml and need to extract values using sql

<?xml version="1.0" ?>  
<fields>  

<field name="fld_AccomAttic">  
<value>0</value>  
</field>  
<field name="fld_AccomBathroom">  
<value>1</value>  
</field>
</fields>  

</xml>

I need to get column name fld_AccomAttic
Value 1

The xml is held in a sql server 2005 db

I have used xquery before and it has worked.

Can any one show me how to extract these values

Im baffeled as to why i am unable to do this

Thanks Sp

© Stack Overflow or respective owner

Related posts about sql

Related posts about Xml