title: Arithmetic overflow error for data type tinyint, value = -1
body: <p>On running this query, I am getting error, Any Idea why?</p>
  
  <pre><code>select ISNULL(NULLIF(0,0), -1)
  </code></pre>
  
  <p>Error : </p>
  
  <p>Msg 220, Level 16, State 2, Line 1</p>
  
  <p>Arithmetic overflow error for data type tinyint, value = -1.</p>
  
  <p>EDIT -- another example:</p>
  
  <pre><code>select ISNULL(NULLIF(0.0,0.0), 1.0)
  </code></pre>
  
  <p>Msg 8115, Level 16, State 8, Line 1
  Arithmetic overflow error converting numeric to data type numeric.</p>