SQL Server : trigger how to read value for Insert, Update, Delete

后端 未结 3 2046
予麋鹿
予麋鹿 2021-02-04 01:25

I have the trigger in one table and would like to read UserId value when a row is inserted, updated or deleted. How to do that? The code below does not work, I get

3条回答
  •  -上瘾入骨i
    2021-02-04 02:24

    There is no updated dynamic table. There is just inserted and deleted. On an UPDATE command, the old data is stored in the deleted dynamic table, and the new values are stored in the inserted dynamic table.

    Think of an UPDATE as a DELETE/INSERT combination.

提交回复
热议问题