How to set multiple values inside an if else statement?
<p>I'm trying to SET more than one value within the if else statement below, If I set one value it works, but if I set two values, it doesn't work:</p>

<pre><code>DECLARE @test1 varchar(60);
DECLARE @test2 varchar(60);


IF ((SELECT COUNT(*) FROM table WHERE table.Date &gt; '2016-03-20') &gt; 10)
SET @test1 = 'test1'
SET @test2 = 'test2' 
ELSE
SET @test1 = 'testelse'
SET @test2 = 'testelse'
</code></pre>

<blockquote>
  <p>Error message: "Msg 156, Level 15, State 1, Line 9 <br>
  Incorrect syntax near the keyword 'ELSE'."</p>
</blockquote>

<p>However it seems to be possible to have multiple SET variables after the else; this code works:</p>

<pre><code>IF ((SELECT COUNT(*) FROM table WHERE table.Date &gt; '2016-03-20') &gt; 10)
SET @test1 = 'test1'
ELSE
SET @test1 = 'testelse'
SET @test2 = 'testelse'
</code></pre>

<p>How can I do this correctly?</p>