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
SQL Server COLUMNS_UPDATED() Function for Triggers. This function is used to know the inserted or updated columns of a table or view. It returns a VARBINARY stream that by using a bitmask allows you to test for multiple columns.
Is there any way I can make this work? Thanks everyone! Trigger can NOT alter the table which altering fires this thigger. No exclusions.
Introduction to MySQL AFTER UPDATE triggers In this syntax: First, specify the name of the trigger that you want to create in the CREATE TRIGGER clause. Second, use AFTER UPDATE clause to specify the time to invoke the trigger. Third, specify the name of the table to which the trigger belongs after the ON keyword.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With