--create update trigger
CREATE TRIGGER update_HealthGoalsHistory
ON HealthGoals
FOR update
AS
BEGIN
INSERT INTO HealthGoalsHistory
( del.HealthGoalID,
del.GoalTypeID,
del.OperatorID,
del.Op1,
del.Op2,
del.StartDate
)
select HealthGoalID,
GoalTypeID,
OperatorID,
Op1,
Op2,
StartDate
from deleted del
END