June 21, 2019 at 2:44 pm
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?
June 21, 2019 at 3:44 pm
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
June 21, 2019 at 4:15 pm
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.
June 21, 2019 at 6:05 pm
thanks, I will look into merge replication.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy