title: SQL Task (SSIS) - An error occurred while extracting the result into a variable of type (DBTYPE_DATE)?
body: <p>I have to work in an existing SSIS solution. One of the initial steps is simply truncate an existing Oracle table.</p>
  
  <p>The existing problematic SQL Task is as per below (replaced the schema and table)</p>
  
  <pre><code>&lt;DTS:Property DTS:Name="Expression"&gt;"truncate table schema.table"&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="EvaluateAsExpression"&gt;-1&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="Namespace"&gt;User&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="ReadOnly"&gt;0&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="RaiseChangedEvent"&gt;0&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="IncludeInDebugDump"&gt;2345&lt;/DTS:Property&gt;&lt;DTS:VariableValue DTS:DataType="8"&gt;truncate table ledger.fusion_fx_rates_processstaging&lt;/DTS:VariableValue&gt;
  &lt;DTS:Property DTS:Name="ObjectName"&gt;SQL_VariableSQL_ClearDownFusionFXRatesProcessstaging&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="DTSID"&gt;{71911B6D-A0F8-49E4-9F7C-769BAEB5E8F9}&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="Description"&gt;&lt;/DTS:Property&gt;
  &lt;DTS:Property DTS:Name="CreationName"&gt;&lt;/DTS:Property&gt;&lt;/DTS:Variable&gt;
  </code></pre>
  
  <p>The first strange to me is that when I open the task in the Control Flow, and press the "build query" button, I get the "Unable to parse query text" error. For some reason the truncate word in the statement has "", so if I remove them, and pressing the "run" button it prompts for the password of the database and it succeeds (which suggests there's no issue with the OleDB connection). However when I click ok to close the menu, I get again the "unable to parse text" error, and if I go back to the menu I was before, I have again the "" around the truncate (only on that word, not on the whole statement).</p>
  
  <p>In the end, when I run the solution, I have this error in the Output:</p>
  
  <blockquote>
    <p>"An error occurred while extracting the result into a variable of type
    (DBTYPE_DATE)". Possible failure reasons: Problems with the query,
    "ResultSet" property not set correctly, parameters not set correctly,
    or connection not established correctly.</p>
  </blockquote>
  
  <p>In the SQL Task Edit there's no result set defined, and obviously I'm not trying to obtain any type of result with a truncate statement, so I wonder what might be the problem? I'm using BIDS 2008.</p>
  
  <p>I've tried change the property of the SQLSourceType from Variable to DirectInput, and then put the SQL Statement directly, but it gives the same error.</p>