Reputation: 104692
In an insert trigger I use table 'INSERTED'
to get the inserted values.
Do I use same INSERTED
table in update trigger as well, or here comes in an 'UPDATED'
table?
Upvotes: 2
Views: 113
Reputation: 116977
Just a note to augment the other answers - INSERTED and DELETED are available to triggers, but also to the OUTPUT clause.
If you're just doing relatively simple tasks, such as selecting or storing the inserted/updated data, the OUTPUT clause can help you avoid using triggers altogether, which is advantageous as triggers tend to be rather transparent.
Upvotes: 0
Reputation: 120917
INSERTED
contains the new values and DELETED
contains the old values.
Upvotes: 2
Reputation: 72840
Yes, for the new values, you do. For the values being replaced, you use the same DELETED
virtual table as in a delete trigger.
Upvotes: 1