开发者

What should be the table contain updated row for update trigger

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 logi开发者_如何学Pythoncal 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜