title: SQL Query to parse XML field and retrieve values
body: <p>I am attempting to parse an XML field which is part of the SCOM 2007 Data Warehouse database and have found many examples which show similar scenarios of achieving this however nothing appears to return values, typically when I run the query it errors.</p>
  
  <p>Here is an example, one row of a thousand or so I need to run this against, where I want to pull in the values England and UK (the GUID's which comprise the tag are consistent for each data type so never change and can be used to query etc). Of course each row has a different city and country code and that is what I want to capture.</p>
  
  <p>The table name is dbo.ManagedEntityProperty and the column name is PropertyXML</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Root&gt;
              &lt;Property Guid="AFB4F9E6-BF48-1737-76AD-C9B3EC325B97"&gt;192.168.1.0&lt;/Property&gt;
              &lt;Property Guid="5C324096-D928-76DB-E9E7-E629DCC261B1"&gt;WASPDC01.LIV10.Local&lt;/Property&gt;
              &lt;Property Guid="96981E2D-DECF-7CB7-DEC5-5C52046B68A6"&gt;192.168.1.0&lt;/Property&gt;
              &lt;Property Guid="FA3887C3-F274-306A-867C-37105A190F78"&gt;England&lt;/Property&gt;
              &lt;Property Guid="61AA7309-595F-576E-337E-E9335E5CA773"&gt;255.255.255.0&lt;/Property&gt;
              &lt;Property Guid="F8ABF27F-A169-6FCD-1862-C06F1DB4BF24"&gt;UK&lt;/Property&gt;
              &lt;Property Guid="B832B2DE-A649-60A1-AC13-06F1EC601E5F"&gt;Active&lt;/Property&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>Any advice or guidance? I attempted to implement advice as per <a href="https://stackoverflow.com/questions/12913724/sql-server-query-xml-attribute-for-an-element-value">SQL Server query xml attribute for an element value</a> but I am still very much in my SQL XML query infancy and have never had to do something like this before.</p>