Trigger to update/Insert record

  • I have a table that resides on 2 different Servers with the same database name.  I want to create a trigger that updates db2.table2 if db1.table1 has a record inserted or updated and visa versa, if db1.table1 gets updated or inserted then update db2.table2.  The table has the same structure.  How can i do this with a trigger?

  • Merge replication is probably the way to go here.  You could try rolling your own solution with triggers, but I guess it would soon get out of sync.

    John

  • I'd lean towards merge here as well, even though it feels like overkill. Doing this with triggers is complex, as you'd likely need linked servers and some sort of merge conflict resolution, which is built into merge replication.

     

  • thanks, I will look into merge replication.

Viewing 4 posts - 1 through 3 (of 3 total)

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