title: Simple trigger on salary
body: <p>I am new to sql and i have an employee table. I want to create a trigger so that no one can insert a new employee record with salary less than 200. I tried this code but it doesn't accept any record anymore and i see this error "The transaction ended in the trigger. The batch has been aborted." whatever the salary is.</p>
  
  <p>This is my code </p>
  
  <pre><code>Create trigger Trig on Employees after insert
  As
  Begin
     if((Select count(EID) from inserted where salary&lt;200)&gt;0)
        Rollback
     else
        Commit
  End
  </code></pre>
  
  <p>Thanks in advance</p>