title: SQL SET statement
body: <p>I am currently improving my knowledge of SQL. Currently I am trying to declare a variable by getting a value from a select statement. First Question: Is this possible?</p>
  
  <p>Second Question: I have this SQL attempting to do the above. My intension is to set <code>@version_group</code> to whatever <code>version_replace</code> holds, which is always a single row, single column result.</p>
  
  <pre><code>    DECLARE @version_group int
      SET @version_group = SELECT version_replace FROM users WHERE id=@sid
  </code></pre>
  
  <p>How can I correct this to valid syntax? (assuming it's possible)</p>