title: How to fire trigger after all records inserted?
body: <p>In SQL server, when does a trigger get fired? </p>
  
  <p>The problem is, I have a table where 45,000 records are going to be inserted.
  And I want to copy all 45k records to other tables. 
  But I don't want the trigger to run on every insert, i.e 45000 times trigger. </p>
  
  <p>My trigger is basically copying record from TableA to TableB. </p>
  
  <p>Trigger: </p>
  
  <pre><code>Create trigger tri_1
  on TableA
  after insert
  as 
  
  Begin 
  
  Insert into TableB (ID,Name,Others)
  select ID,Name,Others from TableA
  inner join inserted
  on inserted.ID = TableA.ID
  
  End
  </code></pre>
  
  <p>The above is just the template of my trigger. </p>
  
  <p>Also, I have a question, the trigger mentioned above, how is it working? like firing for each row or after all insert is done? </p>