我有一张桌子tblBilling和tblTotalFee。我在tblBilling中的一列名为RemainingAmount,在tblTotalFee我有另一列名为Due From Previous Month。现在我想要的是当我在Remaining Amount中插入一个值时,我希望该值自动插入到Due From Previous Month中。我正在尝试编写一个触发器。但我就是做错了??谁能帮我??
我试过:
ALTER trigger [dbo].[trg_Billing_TotalFee] on [dbo].[tblBilling]
after insert as
insert into tblTotalFee(DueFromPreviousMonth)
select RemainingAmount from inserted