title: Trigger: How does the inserted table work? How to access its rows?
body: <p>I have the following table</p>
  
  <pre><code>Data --Table name
  ID -- Identity column
  PCode -- Postal Code
  </code></pre>
  
  <p>I created the following trigger:</p>
  
  <pre><code>CREATE TRIGGER Trig
  ON Data
  FOR INSERT
  AS
  BEGIN 
  
      Select * from inserted
  
  END
  </code></pre>
  
  <p>And inserted the following values</p>
  
  <pre><code>INSERT INTO Data VALUES (125)
  INSERT INTO Data VALUES (126)
  INSERT INTO Data VALUES (127)
  </code></pre>
  
  <p>It shows this:</p>
  
  <p><a href="https://i.stack.imgur.com/wSYzz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wSYzz.png" alt="enter image description here"></a></p>
  
  <p>But I was expecting something like this:</p>
  
  <ul>
  <li>After the 1st insertion, the trigger is executed -> one row is shown in the <code>inserted</code> table.</li>
  <li>After the 2nd insertion, the trigger is executed -> two rows are shown in the <code>inserted</code> table.</li>
  <li>After the 3rd insertion, the trigger is executed -> three rows are shown in the <code>inserted</code> table.</li>
  </ul>
  
  <p>According to <a href="https://msdn.microsoft.com/en-us/library/ms191300.aspx" rel="noreferrer">msdn.microsoft</a> all the rows inserted are in this table. </p>
  
  <hr>
  
  <p>How can I access the <code>inserted</code> table so that I can see all the expected rows and not separately?</p>