Author |
Topic |
ya3mro
Starting Member
37 Posts |
Posted - 2006-05-18 : 06:56:04
|
Thanx Too mush for ur articlw but it seem to me that ur Solution of the Real System Problem can make a big problem that every time a Row is added to the IntelLog the Trigger will be fired and this will make a load each time row addedfor example if 500 rows is added in the same timewe will have A 500 Operation Over So i want to understanf from u if what i said is right or i have a misunderstandi hope for ur Reply on my Email amr.badawy@egyptnetwork.comhttp://english.islamway.com |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2006-05-18 : 11:52:50
|
I have no idea what you are talking about. Is there some article you are referring to?-ec |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2006-05-18 : 15:47:44
|
Load? Do you mean transaction? Or INSERT?Michael<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>Opinions expressed in this post are not necessarily those of TeleVox Software, inc. All information is provided "AS IS" with no warranties and confers no rights. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-05-18 : 16:23:18
|
If 500 rows are added to a table in one batch, then the trigger will only fire once. The inserted trigger table will contain 500 rows.Tara Kizeraka tduggan |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2006-05-19 : 21:10:17
|
quote: Originally posted by tkizer If 500 rows are added to a table in one batch, then the trigger will only fire once. The inserted trigger table will contain 500 rows.Tara Kizeraka tduggan
Tara,Lets say I have a batch/dts job running middle of night on a daily basis and if it inserts / updates 10000 records. I have triggers for both update and insert on that table, what will happen in this scenario? Will the insert and update trigger will be fired only once each?ThanksKarunakaran |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-05-19 : 21:27:56
|
It will fire once for each INSERT statement issued, and once for each UPDATE statement issued. |
|
|
karuna
Aged Yak Warrior
582 Posts |
Posted - 2006-05-19 : 21:42:36
|
quote: Originally posted by robvolk It will fire once for each INSERT statement issued, and once for each UPDATE statement issued.
quote: Originally posted by tkizerIf 500 rows are added to a table in one batch, then the trigger will only fire once. The inserted trigger table will contain 500 rows.Tara Kizeraka tduggan
Thats 10000 trigger firing we are talking about? or I'm totally misunderstanding things here...Say if the batch process inserts 8000 records and updates 2000 records....ThanksKarunakaran |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2006-05-19 : 23:15:03
|
If you use BCP or bulk insert the triggers are disabled by default.-ec |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-20 : 09:19:52
|
It depends on how the dts package is created. For the insert it may fire the insert trigger for each insert or not at all (depends a lot on how the destination is defined and what properties you select). It's easy to test to see what is happening. It coud fire once for the whole batch insert but if you had coded it to do that I think you would know.For the update the update trigget will fire once for each update statement - i.e. if you have a single update statement that affects all rows in the table then the update trigger will fire once (and the inserted/deleted tables will contain all rows in the table).For the number of rows you are talking about this shouldn't be a problem if the triggers are coded efficiently.Have a look athttp://www.nigelrivett.net/#Triggers==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
|
|
|