How can I edit values of an INSERT in a trigger on SQL Server?

后端 未结 5 1835
猫巷女王i
猫巷女王i 2020-12-10 10:05

I have the table Tb

ID | Name   | Desc
-------------------------
 1 | Sample | sample desc

I want to create a trigger on INSER

5条回答
  •  萌比男神i
    2020-12-10 11:01

    You may want to look at INSTEAD OF triggers.

    CREATE TRIGGER Tb_InsteadTrigger on Tb
    INSTEAD OF INSERT
    AS
    BEGIN
    ...
    

    This will allow you to manipulate the data before it goes into the table. The trigger is responsible for inserting the data to the table.

提交回复
热议问题