views:

93

answers:

1

Hi everyone,

A while ago i read the article for Trigger in SQL Server, and it said that i can use the Logical Table "Updated" for updated rows... And i got error:

System.Data.SqlClient.SqlException: Invalid object name 'Updated'.

After a while of google, i found out some more post that said only 2 logical tables available are: Inserted and Deleted...

I'm confused... What should i use since my Trigger rely on the Updated table that contain the updated row, and use it to insert to another table or the same table with new PK...

Thank you very much

+1  A: 

The two dummy tables are called Inserted (available in INSERT and UPDATE triggers) and Deleted (available in DELETE and UPDATE triggers).

There is no Updated dummy table in SQL Server triggers.

For an FOR UPDATE trigger, the Deleted table contains the old values, while the Inserted table contains the new ones.

Marc

marc_s
Thanks for this, marc.
DucDigital