title: Use Results of an XMLA query in Integration Services
body: <p>I have an XMLA query which returns the State and Last Processed date of an Analysis Services cube as XML, like so:</p>
  
  <p>Query:</p>
  
  <pre><code>&lt;Discover xmlns="urn:schemas-microsoft-com:xml-analysis"&gt;
    &lt;RequestType&gt;DISCOVER_XML_METADATA&lt;/RequestType&gt;
    &lt;Restrictions &gt;
      &lt;RestrictionList xmlns="urn:schemas-microsoft-com:xml-analysis"&gt;
        &lt;DatabaseID&gt;SSAS - Premium and Claims V2&lt;/DatabaseID&gt;
        &lt;CubeID&gt;PDW04 1&lt;/CubeID&gt;
        &lt;ObjectExpansion&gt;ReferenceOnly&lt;/ObjectExpansion&gt;
      &lt;/RestrictionList&gt;
    &lt;/Restrictions&gt;
    &lt;Properties /&gt;
  &lt;/Discover&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&lt;return xmlns="urn:schemas-microsoft-com:xml-analysis"&gt;
    &lt;root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;xsd:schema targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:sql="urn:schemas-microsoft-com:xml-sql" elementFormDefault="qualified"&gt;
        &lt;xsd:element name="root"&gt;
          &lt;xsd:complexType&gt;
            &lt;xsd:sequence minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xsd:element name="row" type="row" /&gt;
            &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
        &lt;/xsd:element&gt;
        &lt;xsd:simpleType name="uuid"&gt;
          &lt;xsd:restriction base="xsd:string"&gt;
            &lt;xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}" /&gt;
          &lt;/xsd:restriction&gt;
        &lt;/xsd:simpleType&gt;
        &lt;xsd:complexType name="xmlDocument"&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:any /&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
        &lt;xsd:complexType name="row"&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:element sql:field="METADATA" name="METADATA" type="xmlDocument" /&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
      &lt;/xsd:schema&gt;
      &lt;row&gt;
        &lt;xars:METADATA xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:xars="urn:schemas-microsoft-com:xml-analysis:rowset"&gt;
          &lt;Cube&gt;
            &lt;Name&gt;Premium&lt;/Name&gt;
            &lt;ID&gt;PDW04 1&lt;/ID&gt;
            &lt;CreatedTimestamp&gt;2008-11-23T22:31:06&lt;/CreatedTimestamp&gt;
            &lt;LastSchemaUpdate&gt;2009-01-22T00:50:13&lt;/LastSchemaUpdate&gt;
            &lt;LastProcessed&gt;2009-01-07T22:28:34&lt;/LastProcessed&gt;
            &lt;State&gt;Processed&lt;/State&gt;
          &lt;/Cube&gt;
        &lt;/xars:METADATA&gt;
      &lt;/row&gt;
    &lt;/root&gt;
  &lt;/return&gt;
  </code></pre>
  
  <p>I would like to be able to use this XMLA query in an Integration Services package, parsing and storing the result in a SQL Server database table. However the only tasks that seems to execute an XMLA query is the "Analysis Services Execute DDL" task, which does not have a method of returning results of the query as far as I can tell.</p>
  
  <p>Does anyone have any suggestions on how else to achieve this?</p>