对SQL数据库一个表插入的数据,某个ID刷卡时间大于17:00,就把这个时间自动修改成17:00?触发器怎么写?

2025-03-04 14:01:56
推荐回答(1个)
回答1:

CREATE TRIGGER TR_INSERT
ON TABLE
AFTER INSERT
AS
If inserted.ID = '003' and Inserted.Rectime>17:00
Update Table SET rectime = 17:00 where ID=003

数据类型你自己修改