Inserted ? deleted ?个人理解 应该是两个 临时表 ? 分别存储 变动后的数据集 ?和 ?变动前的数据集
?
使用例子:?
?
1.对于INSERT,可以引用inserted表以查询新行的属性.?
? ?insert into [表名] (a) OUTPUT Inserted.a values ('a') ? ? ?
?
2.对于DELETE,可以引用deleted表以查询旧行的属性.?
? ?delete [表名] OUTPUT deleted.a where links = 'a'?
?
3.对于UPDATE,使用deleted表查询被更新行在更改前的属性,用inserted表标识被更新行在更改后的值.?
? ?update [表名] set a = 'b' OUTPUT Inserted.a where a = 'a'(返回修改后的值)?
? ?update [表名] set a = 'b' OUTPUT deleted.a where a = 'a' (返回修改前的值)