テーブルtblBillingとtblTotalFeeがあります。tblBillingの私の列の 1 つは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