title: Store Procedure Select into a variable
body: <p>How can I count the result of a table and pass into a Stored Procedure Variable?</p>
  
  <pre><code>DECLARE @totalrecs varchar
  select count(id) from table1
  </code></pre>
  
  <p>I want the count record in the totalrecs variable.</p>