order_details
이라는 테이블과 book_inventory
이라는 테이블이 있습니다.SQL Server 2005 트리거가 작동하지 않습니다.
내가 quantity_ordered
인 경우 order_details
에서 quantity_in_stock
에서 book_inventory
으로 그 값을 줄여야합니다. ,
create TRIGGER [dbo].[book]
ON [dbo].[order_details]
AFTER UPDATE
AS
IF UPDATE(quantity_ordered)
UPDATE book_inventory
SET book_inventory.quantity_in_stock = book_inventory.quantity_in_stock - order_details.quantity_ordered
FROM order_details
WHERE book_inventory.isbn = order_details.isbn
가 어디 질문 할 것이다 나에게 seemes : 여기
내 코드? 한편 –- 트리거에서 INSERTED 및 DELETED 별칭을 사용하지 않습니다. 의도 한 동작입니까? –