如何创建触发器以自动填充我的应用程序中的列作为计数器?

时间:2021-04-05 09:07:27

I have written a trigger, but it doesn't work well.

我写了一个触发器,但它不能正常工作。

如何创建触发器以自动填充我的应用程序中的列作为计数器?

How to make it work to fill the column automatically, without user intervention, when I create an activity?

在创建活动时,如何使其无需用户干预即可自动填充列?

I use SQL Server.

我使用SQL Server。

1 个解决方案

#1


0  

You need an after trigger and not an instead of trigger change your trigger to after trigger

您需要一个后触发器而不是触发器而不是触发器将触发器更改为触发后

CREATE TRIGGER TriggerName
AFTER INSERT
  ON TableName 
BEGIN
  //Your Code
END;

#1


0  

You need an after trigger and not an instead of trigger change your trigger to after trigger

您需要一个后触发器而不是触发器而不是触发器将触发器更改为触发后

CREATE TRIGGER TriggerName
AFTER INSERT
  ON TableName 
BEGIN
  //Your Code
END;