none
Insert to a table after an Insert Trigger. RRS feed

  • Question

  • Hi Experts,

    I have two tables in two different data bases. Account(no,name,address)  in Flex DB  and CustomerInfo(no,name) in Flow DB.

    How I will write an sql Insert trigger to insert values to table CustomerInfo for every insertion of record to table Account.


    AshisK

    Sunday, April 26, 2015 7:05 PM

Answers

  • create trigger trgInsert on dbo.Account
    after insert
    as
    Insert into FlowDB.dbo.CustomerInfo(no,name)
    select no,name from inserted

    you need to create this trigger in flexDB database. since the question was only about inserts, the code will only capture inserts happening on the Account table.


    Hope it Helps!!


    Sunday, April 26, 2015 7:22 PM