title: Formatting RAISERROR messages in SYBASE ASE 12.5
body: <p>In a stored procedure, I am trying to test if a parameter is null or less then 1, and if so, raise an error with a friendly message, and the value of the parameter.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>IF @ID IS NULL OR @ID &lt;= 0
  BEGIN
      RAISERROR 27001 'ID is ?????. ID cannot be null or less then zero.'
      RETURN 27001
  END
  </code></pre>
  
  <p>What I would like back is either:</p>
  
  <p><em>"ID is 0. ID cannot be null or less then zero."</em>
  or
  <em>"ID is null. ID cannot be null or less then zero."</em></p>
  
  <p>I've tried building a varchar and raising the error like this:</p>
  
  <pre><code>RAISERROR 27001 @message
  </code></pre>
  
  <p>but that produces the error <em>"Message Number 27001, passed to RAISERROR, does not exist in the sysmessages catalog."</em></p>