SQL Server Trigger switching Insert,Delete,Update

后端 未结 5 1908
慢半拍i
慢半拍i 2021-02-09 01:39

Hello is possible to switch between DML commands/operations (Insert,Delete,Update) on Trigger Body?, I try to snippet some T-SQL for understand me better :

CREA         


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-02-09 02:20

    You can use the inserted and deleted tables to see what changes were made to the table.

    For an UPDATE, the deleted table contains the old version of the row, and inserted the new version.

    DELETE and INSERT use their own table as you would expect.

提交回复
热议问题