title: How to insert records from one table to other when multirow inserted in table using trigger?
body: <p>I have 2 tables:
  <code>Table 1</code> and <code>Table 2</code>.
  What i want to do, i want copy newly inserted records from Table1 to Table2 using trigger.
  I created trigger on Table1, when bulk of data inserted in table1 it will copy newly inserted records in Table2. It work for single row insertion but not for multi row insertion.
  Please let me know,what is wrong in that?</p>
  
  <pre><code>CREATE TRIGGER [dbo].[TRIG_TABLE1]
  ON [dbo].[Table1]
  AFTER INSERT AS
  IF @@ROWCOUNT &gt;=1  
  BEGIN
  INSERT INTO Table2
  (CustID
  ,DateCreated
  ,DateModify)
  SELECT i.CustID
  ,i.DateCreated
  ,i.DateModify
  FROM Table1 as i
  WHERE (i.CustID  IN (select CustID from INSERTED) and i.DateCreated  IN (select   DateCreated from INSERTED))
  </code></pre>