create trigger Order_Trigger on Order for update as begin set nocount on declare @id int select @id=Orderid from inserted begin update OrderDetail set Orderid=@id where Orderid=(select Orderid from inserted) end end
delimiter |
CREATE TRIGGER Order_Trigger AFTER UPDATE ON `Order`
FOR EACH ROW BEGIN
UPDATE OrderDetail SET Orderid=NEW.Orderid WHERE Orderid=OLD.Orderid ;
END;
|
delimiter ;
------解决方案-------------------- where current of cur_bbb 这句没看明白啊
------解决方案-------------------- orderID不应该修改的。主键无需修改。你担心数字上限?
------解决方案-------------------- 简答的问题复杂化?