title: Execute SQL Task -Full Result Set Datatype Mismatch Error
body: <p>I am creating an SSIS package which has an execute SQL task and it passes result set variable to a for each loop container. 
  My Sql Query is:</p>
  
  <pre><code>Select distinct code from house where active=1 and campus='W'
  </code></pre>
  
  <p>I want the execute sql task to run this query and assign its results to a variable which is passed to a for each loop container which should loop through all the values in the result set.</p>
  
  <p>But my execute sql task fails with error:</p>
  
  <blockquote>
    <p>The type of the value (DBNull) being assigned to variable
    "User::house" differs from the current variable type (String)</p>
  </blockquote>
  
  <p>Now i have done my research and i have tried assigning the variable datatype Object but did not work. I tried using cast in my sql query and that also did not work.</p>
  
  <p>Since my query returns multiple rows and one column, i am not sure how i can assign a datatype to the whole query?</p>
  
  <p>Sample:</p>
  
  <ul>
  <li>Code </li>
  <li>AR </li>
  <li>BN </li>
  <li>CN </li>
  </ul>