title: SQL Server 2000 "Incorrect syntax near the keyword 'CASE'"
body: <p>The error is return when the following stored proc is attempted to be executed:</p>
  
  <pre><code>EXECUTE p_someProc
  --list of vars
  CASE WHEN @var1=1 AND @var2=1 THEN 3 
       WHEN @var2=1 THEN 2 
       WHEN @var1=1 THEN 1 END,
  --more vars
  </code></pre>
  
  <p>There are other CASE functions included, though only a single error is spewed up which points to the first CASE.</p>
  
  <p>When the identical expression is run within a PRINT function, an expected result is returned.</p>
  
  <pre><code>declare @var1 bit set @var1 = 1
  declare @var2 bit set @var2 = 1
  
  print(CASE WHEN @var1=1 AND @var2=1 THEN 3 
       WHEN @var1=1 THEN 2 
       WHEN @var2=1 THEN 1 END)
  </code></pre>
  
  <p>The output is '3'</p>
  
  <p>I assume that I'm misusing the CASE function somehow. Could anyone think of a workaround or a way to fix it?</p>
  
  <p>Thanks in advance.</p>
  
  <p>--Stan</p>