MMIMadness
Technical User
I have a trigger that updates a date time field every time the particular record is edited, so i can keep a bit of an audit trail. but what i need to do is stop the trigger from fireing if either of two feilds are changed as i don't need to audit them and it does muck up the audit procedure. is their any way of checking if a particular field has been changed and then stopping the trigger/update code to fire.
E.G.
If col1 = change or col2 = change then
don't run update
else
update audit col
end if
that sort of thing.
if anyone can help i would be most gratful.
Adam,
The current trigger code
E.G.
If col1 = change or col2 = change then
don't run update
else
update audit col
end if
that sort of thing.
if anyone can help i would be most gratful.
Adam,
The current trigger code
Code:
CREATE TRIGGER Update_time ON [dbo].[Tbl_Core_details]
FOR insert, UPDATE
AS
DECLARE
@TrigTime DateTime
set @TrigTime = getDate()
update
tbl_core_details
SET
Update_time = (@trigtime)
from
inserted, tbl_core_details
WHERE
tbl_core_details.apid = inserted.apid