views:

51

answers:

3

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?

+1  A: 

Yes, for the new values, you do. For the values being replaced, you use the same DELETED virtual table as in a delete trigger.

David M
+2  A: 

INSERTED contains the new values and DELETED contains the old values.

klausbyskov
A: 

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.

womp