CREATE TRIGGER SetQT ON [dbo].[ClassThird]
FOR UPDATE
AS update ClassFour set ClassFour.Product_show=0 inner join inserted where ThirdID=ThirdID and Product_Show=0
*************上面的触发器提示inner附近有语法错误。**********************在ClassFour里有一个字段ThirdID。当从ClassThird里更新一个记录的Product_Show=0时候,把ClassFour表里ThirdID等于当前这个记录的Product_Show也设置为0
FOR UPDATE
AS update ClassFour set ClassFour.Product_show=0 inner join inserted where ThirdID=ThirdID and Product_Show=0
*************上面的触发器提示inner附近有语法错误。**********************在ClassFour里有一个字段ThirdID。当从ClassThird里更新一个记录的Product_Show=0时候,把ClassFour表里ThirdID等于当前这个记录的Product_Show也设置为0
FOR UPDATE
AS update ClassFour set Product_show=0
from ClassFour inner join inserted
where ThirdID=ThirdID and Product_Show=0
-or:
update ClassFour set ClassFour.Product_show=0 from ClassFour a,inserted b where a.ThirdID=b.ThirdID and a.Product_Show=0---语法问题
FOR UPDATE
AS update ClassFour set Product_show=0
from ClassFour inner join inserted i
where ClassFour.ThirdID=i.ThirdID and i.Product_Show=0
-or:
update ClassFour set ClassFour.Product_show=0 from ClassFour a,inserted b where a.ThirdID=b.ThirdID and b.Product_Show=0
from ClassFour inner join inserted i
where ClassFour.ThirdID=i.ThirdID and i.Product_Show=0
还是有错。where附近有语法错误。
FOR UPDATE
AS update ClassFour set Product_show=0
from ClassFour inner join inserted
on ThirdID=ThirdID and Product_Show=0
from tb 1,tb 2 where .......
FOR UPDATE
AS update ClassFour set Product_show=0
from ClassFour,inserted i
where ClassFour.ThirdID=i.ThirdID and i.Product_Show=0