Update Trigger

  • Table name: FromTrainersTable

    Primary Key name: FTKey

    Field name to update with current date and time: timestamp1

    Event: When field name [Day1] is updated

    Please help me with a trigger to register the timestamp when the Day1 check box is updated.

     

     

     

  • CREATE TRIGGER tr_FromTrainersTable ON FromTrainersTable FOR UPDATE

    AS

    IF UPDATE(Day1)

    UPDATE FromTrainersTable

    SET TimeStamp1 = GETDATE()

    FROM FromTrainersTable INNER JOIN inserted ON FromTrainersTable.FTKey = inserted.FTKey

    WHERE FromTrainersTable.Day1 inserted.Day1

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply