Please start any new threads on our new site at http://forums.sqlteam.com. 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
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 I think its OVER on sql servre
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ya3mro
Starting Member

37 Posts

Posted - 05/18/2006 :  06:56:04  Show Profile  Visit ya3mro's Homepage  Click to see ya3mro's MSN Messenger address  Send ya3mro a Yahoo! Message  Reply with Quote
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 added

for example if 500 rows is added in the same time

we will have A 500 Operation Over

So i want to understanf from u if what i said is right or i have a misunderstand

i hope for ur Reply on my Email
amr.badawy@egyptnetwork.com

http://english.islamway.com

eyechart
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 05/18/2006 :  11:52:50  Show Profile  Reply with Quote
I have no idea what you are talking about. Is there some article you are referring to?



-ec
Go to Top of Page

MichaelP
Jedi Yak

USA
2489 Posts

Posted - 05/18/2006 :  15:47:44  Show Profile  Visit MichaelP's Homepage  Reply with Quote
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.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
38200 Posts

Posted - 05/18/2006 :  16:23:18  Show Profile  Visit tkizer's Homepage  Reply with Quote
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 Kizer
aka tduggan
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 05/19/2006 :  21:10:17  Show Profile  Send karuna a Yahoo! Message  Reply with Quote
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 Kizer
aka 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?

Thanks




Karunakaran
Go to Top of Page

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 05/19/2006 :  21:27:56  Show Profile  Visit robvolk's Homepage  Reply with Quote
It will fire once for each INSERT statement issued, and once for each UPDATE statement issued.
Go to Top of Page

karuna
Aged Yak Warrior

582 Posts

Posted - 05/19/2006 :  21:42:36  Show Profile  Send karuna a Yahoo! Message  Reply with Quote
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 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 Kizer
aka 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....

Thanks

Karunakaran
Go to Top of Page

eyechart
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 05/19/2006 :  23:15:03  Show Profile  Reply with Quote
If you use BCP or bulk insert the triggers are disabled by default.



-ec

Edited by - eyechart on 05/19/2006 23:15:35
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 05/20/2006 :  09:19:52  Show Profile  Visit nr's Homepage  Reply with Quote
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 at
http://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.
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.04 seconds. Powered By: Snitz Forums 2000