where id =(select id from inserted)

解决方案 »

  1.   

    CREATE TRIGGER [TRIGGER NAME] ON [dbo].[ConsumableStatistics] 
    FOR INSERT
    AS  update [dbo].[ConsumableStatistics] set ordertime=getdate() where where 编号 =(select 编号 from inserted)
      

  2.   

    同意pengdali(大力 V2.0) 的,我以前也用过这种方法
      

  3.   

    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.编号