Firing a Trigger for Each Inserted Row

I'm using an INSERT INTO...SELECT * FROM bulk statement to insert records into a table. If I write a trigger on the target table that executes on INSERT, will the trigger fire for each row inserted? If not, how can I get the trigger to fire for each row?

SQL Server triggers fire only once per statement, not once per affected row. So, you'll have to create the multiple-row updates yourself in your trigger.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish