title: SQL Server Sum query
body: <p>Today my problem is this I have 2 columns and I wish to check if the sum of those columns isn't bigger than a value (485 for example) and if is do a query...</p>
  
  <p>I though to do </p>
  
  <pre><code>SELECT * FROM table WHERE ColumnA + ColumnB &lt; 485
  </code></pre>
  
  <p>But it isn't working... I've already tried with </p>
  
  <pre><code>SELECT Sum(ColumnA) + Sum(ColumnB) AS Total FROM table
  </code></pre>
  
  <p>but it gives me 1 column with the sum of all rows, I instead want a row for every sum. So how can I do..? xD I hope you understood if not just ask that I try to explain it better! and thanks in advance for those who will help me!</p>
  
  <p>EDIT: I Found out XD the problem was that the columns was Smallint and the result of 1 or more rows was more than 32k so it wasn't working! Thanks all!!</p>