SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

skillile
Posting Yak Master

USA
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.

Thanks

slow down to move faster...

robvolk
Most Valuable Yak

USA
15659 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  
 New 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.06 seconds. Powered By: Snitz Forums 2000