autocutter
Programmer
I am having some problems with auditing insert/update/delete actions using triggers. What I am seeing is that I can catch the action & values from the insert/delete tables in to the audit table, but the original row changes it self to a previoues row until I do a requery of the original table. The trigger:
Create trigger auditInsert on dbo.Award
For Insert
as
Declare
@CustID as int,
@CustAmt as Varchar(30)
Set @CustID = Select CustID from Inserted
set @CustAmt = Select CustAmt from Inserted
set nocount on
Insert into AwardAudit(CustID, CustAmt, Date, User)
Values(@CustID, @CustAmt, GetDate(), sUser_sName())
set nocount off
What am I messing up-I have tried For, After, Instead of-used New & Old after the Inserted table reference, but nogo. And yes I have searched the the answer, but nogo II. Help!
Create trigger auditInsert on dbo.Award
For Insert
as
Declare
@CustID as int,
@CustAmt as Varchar(30)
Set @CustID = Select CustID from Inserted
set @CustAmt = Select CustAmt from Inserted
set nocount on
Insert into AwardAudit(CustID, CustAmt, Date, User)
Values(@CustID, @CustAmt, GetDate(), sUser_sName())
set nocount off
What am I messing up-I have tried For, After, Instead of-used New & Old after the Inserted table reference, but nogo. And yes I have searched the the answer, but nogo II. Help!