CREATE TRIGGER [TRIGGER NAME] ON [dbo].[ConsumableStatistics] FOR INSERT AS update [dbo].[ConsumableStatistics] set ordertime=getdate() where where 编号 =(select 编号 from inserted)
同意pengdali(大力 V2.0) 的,我以前也用过这种方法
CREATE TRIGGER [TRIGGER NAME] ON [dbo].[ConsumableStatistics] FOR INSERT AS update a set ordertime=getdate() From ConsumableStatistics a(Nolock) Join Inserted b on a.编号 =b.编号
FOR INSERT
AS update [dbo].[ConsumableStatistics] set ordertime=getdate() where where 编号 =(select 编号 from inserted)
FOR INSERT
AS
update a set ordertime=getdate()
From ConsumableStatistics a(Nolock) Join
Inserted b on a.编号 =b.编号