How to refer to the new inserted row in TSQL Trigger -
I know that if you want to mention a new cast line in plpgsql, you can type " NEW
". How do I do this in T-SQL (Transcript SQL)?
The following trigger is what I am trying to create:
set to set rules_table trigger setAlertId INSERT AS DECLARE @max_id integer SELECT @max_id = (by rules Select the maximum (alert ID). Get the error message to: NEW.AlertId = @ max_id + 1 END
I get the error message:
DML trigger statement two special Tables are used:
deleted
table andinserted
tables. SQL Server automatically creates and manages these tables. You can use these temporary, memory-resident tables to test the effects of some data modifications and set conditions for DML trigger tasks. You can not modify data directly in tables
Comments
Post a Comment