Inserteddeleted personally understands that two temporary tables are used to store changed datasets and datasets before changes respectively. example: 1. for INSERT, you can reference the inserted table to query the attributes of a new row. insertinto [table name] (a) OUTPUTInser... inserted deleted my personal understanding should be that two temporary tables store the changed dataset and the former one respectively.
Example:
1. for INSERT, you can reference the inserted table to query the attributes of a new row.
Insert into [table name] (a) OUTPUT Inserted. a values ('A ')
2. for DELETE, you can reference the deleted table to query the attributes of the old row.
Delete [table name] OUTPUT deleted. a where links = 'A'
3. for UPDATE, use the deleted table to query the attributes of the updated row before the change. use the inserted table to identify the value of the updated row after the change.
Update [table name] set a = 'B' OUTPUT Inserted. a where a = 'a' (return the modified value)
Update [table name] set a = 'B' OUTPUT deleted. a where a = 'a' (return the value before modification)