title: Declaring variable in WITH expression (SQL Server)?
body: <p>is there a way to define a variable inside a WITH expression? Something like:</p>
  
  <pre><code>;WITH SomeName AS ( 
      declare @somevar decimal
      set @somevar = ...
      SELECT ....)
  </code></pre>
  
  <p>Possible?</p>