create trigger CA_P_Q
on orderline for insert
as
begin
update customer set cumulative_Amount=cumulative_Amount+item.Price*inserted.quantity
from inserted,item,order_
where inserted.item_ID=item.item_id
and order_.order_Id=inserted.order_Id
and Customer.Customer_Id=Order_.Customer_Id
end
这是一个餐厅数据库,我想利用触发器在输入订单详情时自动计算消费额并统计在消费者表中
生成触发器时不会报错,输入数据提示数据改变但表内属性没有改变
你下面这行11,11不就是触发器插入的吗,怎么没变了