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
 General SQL Server Forums
 New to SQL Server Programming
 Old and new data from update

Author  Topic 

nunov
Starting Member

17 Posts

Posted - 2010-05-10 : 23:07:54
When I create a trigger INSTEAD OF INSERT I can obtain the inserted data from select * from inserted

The same thing with INSTEAD OF DELETE (select * from deleted)

How can I do that for an UPDATE? I how can I get the old data and the new updated one ?

Thank you

NV

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2010-05-10 : 23:48:06
New data will be in the inserted table - old data will be in the deleted table. In other words, both virtual tables are available for an update. The deleted table will contain the rows before they were updated, the inserted table will contain the rows after they have been updated.
Go to Top of Page

nunov
Starting Member

17 Posts

Posted - 2010-05-11 : 10:51:38
Thank you!

NV
Go to Top of Page
   

- Advertisement -