title: Qlikview SQL: Retrieving Xml columns as data
body: <p>I have a database with the table 'Reports' in SQL Server. In that table is a column named 'Snippet'. this column is of type XML.
  I now want to use the data in that XML column. The code i tried so far is: </p>
  
  <pre><code>SQL SELECT
  T.ref.value ('Name[1]', 'varchar(50)') as Name,
  T.ref.value ('Temperature[1]', 'varchar(50)') as Temperature
  FROM rLoyalty.[dbo].[Reports] CROSS APPLY xml.nodes ('/HARDWARE_INFO/CPU_INFO/CORE') as T(ref);
  </code></pre>
  
  <p>My xml file looks like this: </p>
  
  <pre><code>&lt;HARDWARE_INFO&gt;
    &lt;CPU_INFO&gt;
      &lt;CORE&gt;
        &lt;NAME&gt;CPU Core #1&lt;/NAME&gt;
        &lt;TEMPERATURE&gt;59&lt;/TEMPERATURE&gt;
      &lt;/CORE&gt;
      &lt;CORE&gt;
        &lt;NAME&gt;CPU Core #2&lt;/NAME&gt;
        &lt;TEMPERATURE&gt;58&lt;/TEMPERATURE&gt;
      &lt;/CORE&gt;
      &lt;CORE&gt;
        &lt;NAME&gt;CPU Package&lt;/NAME&gt;
        &lt;TEMPERATURE&gt;59&lt;/TEMPERATURE&gt;
      &lt;/CORE&gt;
    &lt;/CPU_INFO&gt;
  &lt;/HARDWARE_INFO&gt;
  </code></pre>
  
  <p>But this gives me the error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: The XMLDT method 'nodes' can only be invoked on columns of type xml.</p>