CREATE TRIGGER Imytrigger ON a
AFTER INSERT
AS
update a set mydate=GETDATE() from inserted
where a.ID=inserted.ID
go
我这样写,不对呀!!!!!!!!!!
注意:多条记录一同插入
...全文
898打赏收藏
添加一条或多条记录后,如何设置一字段的值
假设有一表 a(id,mydate,name) 如何在触发器的after insert 中写,(mydate 是时间类型) 让mydate 的值为系统时间 CREATE TRIGGER Imytrigger ON a AFTER INSERT AS update a set mydate=GETDATE() from inserted where a.ID=inserted.ID go 我这样写,不对呀!!!!!!!!!! 注意:多条记录一同插入