title: SSIS Can't Store Decimal Output Into Variable (Execute SQL Task)
body: <p>For the life of me I can't figure out how to store a decimal from a Stored Procedure into an SSIS Variable.</p>
  
  <p>I have an Execute SQL Task that returns a result set. I mapped the column to the variable. I keep getting "Input string was not in a correct format". If I'm returning a decimal from my stored procedure and have the variable type as decimal. I would think this would work, but it doesn't.</p>
  
  <p>Other things I've tried...<br>
  - Cast the column as a float and use variable double.<br>
  - Cast the column as a varchar and use variable string (succeeded but didn't store value)<br>
  - I've done variations on using Output instead of resultset but basically same issues.</p>
  
  <p>Any ideas on how I can get this to work?</p>
  
  <p>Thanks in advance!</p>
  
  <p>As requested here are some screenshots:
  This shows the assignment to the variable.
  <a href="https://i.stack.imgur.com/bsChW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bsChW.png" alt="enter image description here"></a></p>
  
  <p>This is showing the variable as a decimal type.
  <a href="https://i.stack.imgur.com/1UBYy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1UBYy.png" alt="enter image description here"></a></p>
  
  <p>This is showing the error received.
  <a href="https://i.stack.imgur.com/FE5ms.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FE5ms.png" alt="enter image description here"></a></p>
  
  <p>I didn't include the stored procedure but it defines vPreviousValue as a decimal(18,4) and returns it in the result set.</p>