title: How to handle NULL values returned by a stored procedure from within SSIS package?
body: <p>I am a newbie to ssis and am having issues with the loading the results of a stored procedure that includes NULL values into a table with ssis.   What I have is follows:</p>
  
  <h3>Step 1</h3>
  
  <p>Execute Stored Procedure on Database1 will return a Full Result Set and put into ADO object <code>User::CallResults</code></p>
  
  <h3>Step 2</h3>
  
  <p>Then I Loop through the results of <code>User::CallResults</code> mapping 2 variables:</p>
  
  <pre>Variable         Index ADO object Type     Nullable  
  User::ID         0      Object              NO  
  User::Result     1        Object              Yes    
  </pre>
  
  <h3>Step 3</h3>
  
  <p>Then in the Insert Row Into Database2 takes each row and executes "insert into dbo.myTable id, result values (?,?)"</p>
  
  <p>I map ID as int and Result as long respectively. </p>
  
  <p>When I execute I get the error:</p>
  
  <p><code>failed with the following error: "An error occurred while extracting the
  result into a variable of type (DBTYPE_I4)". Possible failure reasons:
  Problems with the query, "ResultSet" property not set correctly,
  parameters not set correctly, or connection not established correctly.</code></p>
  
  <p>Seems like this it errors when there is a null in the <code>Result</code>.  Any suggestions to make ssis allow nulls?</p>