Solved

How triggers execute?

Posted on 2007-12-03
3
212 Views
Last Modified: 2013-11-26
Using sql server express

Lets assume that I have a table with a trigger for insert, and I want to insert 50 records into table X one by one. Would the trigger fire every time that a record is inserted into table X, that is 50 times? Would this behavior apply when I use a program to insert the records or would the trigger wait until the 50 records are inserted and then fired?
0
Comment
Question by:vielkacarolina1239
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20396103
Yes it will fire 50 times and it will be applied when you use a program too for inserting.
0
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 500 total points
ID: 20396121
Answer for both you question is YES. Triggers are like rules applied on a table, so doesnt matter you do it from Query analyser or from any other program. It gets triggered when a records is inserted into a table.
0
 

Author Closing Comment

by:vielkacarolina1239
ID: 31412348
Thanks, now I am cleared
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question