title: sql set variable using COUNT
body: <p>I am trying to make a simple query to my server and want the result to be stored in the variable @times.</p>
  
  <pre><code>DECLARE @times int
  
  SET @times = SELECT COUNT(DidWin)as "I Win"
  FROM thetable
  WHERE DidWin = 1 AND Playername='Me'
  </code></pre>
  
  <p>IntelliSense says <code>Wrong syntax near Select</code></p>