Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger Question / Help
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

208 Posts

Posted - 12/06/2002 :  14:09:06  Show Profile  Reply with Quote
How exactly does a trigger fire. Example:

I have multiple rows being selected for insert. Will the trigger fire on each row or after the batch insert. If they do fire on each row could I use a technique to fire on the batch.

Using SQL 2K

App: I want to insert many rows to a staging table and then use a trigger on this table to wake up and move the data around.


slow down to move faster...

Most Valuable Yak

15732 Posts

Posted - 12/06/2002 :  14:28:30  Show Profile  Visit robvolk's Homepage  Reply with Quote
An INSERT trigger fires once per INSERT statement, regardless of how many rows were INSERTed by that statement. If you INSERT 100 rows as 100 separate INSERT statements, the trigger will fire 100 times. It would be far more efficient to INSERT 100 rows in one operation, if possible; then the trigger would only fire once, and it would affect those 100 rows as a batch.

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000