How to modify a Column in trigger

  • Hi, in a trigger for insert. how can i modify the value a column of the record that is going to be inserted.

    thanks in advance

  • When the trigger fires look at the inserted table.

    Update Table

    Set Colx=Colx*2

    From Inserted

    Where table.pk=inserted.pk

    May also have a look at the instead trigger facility.

    Lastly have a look at SQL Server Books Online.

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

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