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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Trigger after insert

Author  Topic 

joaocsc
Starting Member

1 Post

Posted - 2007-03-14 : 16:16:04
People,
I have the trouble below:
I am using a trigger "after insert", to do an operation to each register inserted in the table.
The problem is when an INSERT from SELECT is performed to include register in this table (INSERT INTO TABLE SELECT ...) the trigger is called just one, after all registers have been inserted, and not once per register inserted, as I need.
Anyone can help me?

Thanks.
joaocsc@gmail.com

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-03-14 : 16:24:36
You need to modify your trigger so that it can process multiple rows.

Please post your trigger so that we can show you where the problem is.

http://weblogs.sqlteam.com/tarad/archive/2004/09/14/2077.aspx

Tara Kizer

http://weblogs.sqlteam.com/tarad/
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-03-14 : 16:30:02
You need to look up the use of the virtual "Inserted" and "Deleted" tables used within triggers to identify records affected by a transaction.

e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -