title: Use set in a case statement in SQL Server
body: <p>I would like to set a variable in SQL Server using a <code>CASE</code> statement. For  example:</p>
  
  <pre><code>DECLARE @UNITY VARCHAR(5)
  DECLARE @AUX VARCHAR(5)
  
  CASE
      WHEN @UNITY = 'U1' THEN @AUX = 'M1'
      WHEN @UNITY = 'U2' THEN @AUX = 'M2'
      WHEN @UNITY = 'U3' THEN @AUX = 'M3'
  END
  </code></pre>