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)
 Get the Updated Row ON Update

Author  Topic 

ahmed_3esam
Starting Member

9 Posts

Posted - 2007-07-21 : 04:28:17
Hi

I need to add a trigger fires on Update Or Insert, but i need to get Only the Updated or Inserted ROW not all table

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-21 : 04:44:08
use the inserted table. The inserted table will contains rows affected in the insert or update operation.

Refer to the BOL for more details. Or see http://msdn2.microsoft.com/en-us/library/ms191300.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ahmed_3esam
Starting Member

9 Posts

Posted - 2007-07-21 : 09:18:30
but what about to get the updated row and modify, how the relation will be
(I need to expiration date to each record)
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-21 : 09:42:53
Did you look in the Books Online, as suggested?
INSERTED table holds all new values inserted in the trigger table.
DELETED table holds all old values updated in the trigger table.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -