title: How can i use Parameter Mapping in Execute SQL Task in SSIS?
body: <p>I am trying to  retrieve the value of <code>Key</code> from a table with a simple select statement in SSIS through <code>Execute SQL Task</code>. But have no luck figuring out this error.</p>
  
  <p>I have used one input variable with string data type and used this variable in parameter mapping in <code>Execute SQL Task</code>.  </p>
  
  <blockquote>
    <p>Executing the query "SELECT cast([Key] as Int) FROM   Table where
    column = ?" 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.</p>
  </blockquote>
  
  <p>Note : Datatype for <code>Key</code> column is <code>tinyint</code></p>