Hi all,I'm trying to create an audit trigger and I have the following code:Create Trigger dbo.tu_paymentauditON dbo.PaymentsFOR UPDATEASDeclare @now DATETIMESet @now = getdate()BEGIN TRYInsert INTO dbo.tblPaymentAudit(RowImage,Charges,ChangeDate,ChangeUser)SELECT 'BEFORE',INSERTED.Charges,@now, suser_sname()FROM DELETEDInsert INTO dbo.tblPaymentAudit(RowImage,Charges,ChangeDate,ChangeUser)SELECT 'AFTER',INSERTED.Charges,@now, suser_sname()FROM INSERTEDEND TRYBEGIN CATCH ROLLBACK TRANSACTIONEND CATCH
But when I try to create/execute it, it keeps coming back with the following error:Msg 4104, Level 16, State 1, Procedure tu_paymentaudit, Line 10The multi-part identifier "INSERTED.Charges" could not be bound.Can anyone tell me what's wrong please?Thanks