title: Command(s) completed succesfully returned when result expected
body: <p>The stored procedure I created initially worked, but the requirement changed. The requirement is now basically that the results should be like:</p>
  
  <pre><code>item | totalproperty1 | percentofproperty1 | totalproperty2 | ...
  </code></pre>
  
  <p>In doing this, we need the calculation of the total to be in the denominator of the percentage calculation (to prevent having to recalculate the total again for the percentage). To try and do this, I attempted this:</p>
  
  <pre><code>Declare @Item varchar(50)
  Declare @TotalProperty1 decimal (9,2)
  Declare @PercentProperty1 decimal (9,2)
  Declare @TotalProperty2 decimal (9,2)
  ...
  </code></pre>
  
  <p>the ... is just more declares of total and percent items, same data types throughout (it's an ugly mess, I apologize)</p>
  
  <pre><code>select @Item = item,
         @TotalProperty1 = (--long query to get the total
                            ),
         @PercentProperty1 = (--long query to get the items compared
                               / @TotalProperty1),
         ...
  
  from table1 join table2 on table1.table2ID = table2.ID
  where -- condition
  </code></pre>
  
  <p>The ... in this section is repeats of the Total/Percent calculations, just for different properties.</p>
  
  <p>I've deleted the closing parentheses on each of the subqueries and readded them to verify they match the opening ones of the subqueries. Before, the calculation was basically a total of all the properties matches vs. the total number of items, but the requirement made it more granular.</p>
  
  <p>When I attempt to execute the alter script, it says "Command(s) completed successfully." which is great, but when I attempt to execute the stored procedure, it, too, returns "Command(s) completed successfully." which is not the expected result (I think the "select @item... conditions" section should still return the select statement, correct?).</p>
  
  <p>The main change from the previous working one vs. the current one is that before, I wasn't doing the select variable = query, variable2 = query, etc. but rather a typical select statement. If I had to guess, that'd be the issue, but I was using <a href="http://www.sql-server-helper.com/error-messages/msg-141.aspx" rel="nofollow">this as a guide</a> in relation to the Msg 141 I was receiving midway through.</p>