title: Custom message on TRIGGER ROLLBACK?
body: <p>I have a trigger in SQL Server and when a condition happens, I need to <code>ROLLBACK</code> it. The problem is that I need to set a custom message.</p>
  
  <pre><code>-- This is inside an UPDATE TRIGGER --
  if (condition)
  BEGIN
    ROLLBACK 
    RAISERROR 50100 'custom message' 
  END
  </code></pre>
  
  <p>But it raises 2 errors</p>
  
  <blockquote>
    <p>Msg 50100, Level 16, State 1, Procedure tU_COM_Proposta, Line 42<br>
    custom message<br>
    Msg 3609, Level 16, State 1, Line 1<br>
    The transaction ended in the trigger. The batch has been aborted.  </p>
  </blockquote>
  
  <p>How can I get it to raise only my custom error and at the same time I need to rollback the trigger's transaction?</p>