UPDATE TRIGERS

  • Hi

    I am a begginner with SQL Server. I am having some trouble with a trigger.

    I am trying to accomplish this.

    When table1 is updated I want the record being updated to be inserted into table 2 before the update takes place. So table 2 is copy of the record before the update.

    Is this possible.

    Thanks

    Paul

     

  • you can use Deleted table to get the the record that was updated and get all the feilds and insert them im table2.

    like

    Insert into Table2 Select * from deleted, provided table2 does not have Identity column, or use column list.

    hope this is what you are looking for

    Brij

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

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