title: If condition isn't met, raise error, if not, run procedure
body: <p>I need to have an error display if the conditions aren't met. Both <code>@variable1</code> and <code>@variable2</code> can take only take few values. </p>
  
  <p>Here's my code:</p>
  
  <pre><code>ALTER PROC Test
      (@Variable1 AS INT,
       @Variable2 AS CHAR(2))
  AS
      DECLARE @err_message nvarchar(max)
  
      IF @Variable1 &lt;&gt; 1 OR @Variable1 &lt;&gt; 2 OR @Variable1 &lt;&gt; 3
          SET @err_message = 'Not available'
  
      BEGIN
          RAISEERROR (@err_message,16,1)
      END
  
      IF @Variable2 &lt;&gt; 'IT'
          SET @err_message = 'Not IT'
  
      BEGIN
          RAISEERROR (@err_message,16,1)
      END
  
      RUN PROCEDURE
  </code></pre>
  
  <p>I get an error for <code>RAISEERROR</code> </p>
  
  <blockquote>
    <p>Incorrect syntax. Expecting conversation</p>
  </blockquote>
  
  <p>and with the second <code>IF</code> statement.</p>