Newbie Trigger question

Last post 08-26-2008, 11:00 AM by MVV. 1 replies.
Sort Posts: Previous Next
  •  08-24-2008, 10:22 AM Post number 69249

    Newbie Trigger question

    I'm attempting to create an after trigger that will update a second table with the information I entered in the first table. Any expertise shared would be appreciated.

    CREATE TRIGGER trigger_fun1

    ON tablename

    FOR AFTER

    UPDATE

    WITH APPEND

    AS

    "COULD YOU HELP"

  •  08-26-2008, 11:00 AM Post number 69276 in reply to post number 69249

    • MVV is not online. Last active: 12-01-2008, 6:48 AM MVV
    • Top 25 Contributor
    • Joined on 04-29-2008
    • Alcoy, Spain
    • Level 2: Deep Blue

    Re: Newbie Trigger question

    If both tables are identical , just

    Insert into table2 select * from inserted

    else , the usual

    Insert into table2 (field1,field2...)  select (field1,field2...) from inserted



    Hey , sysadm , leave the users alone
    They are nothing more
    than another brick in the firewall
View as RSS news feed in XML