Reputation: 15
I am working on online and store ordering Pizza project. In this project I have two different databases one is the server where online ordered records will insert and another one is another server database which runs only in the stores.
My requirement is whenever any order is placed in the server database, then that same order must be inserted into the another server database automatically without using triggers.
Is there any solution please let me know ?
Bhavana Ky
Upvotes: 1
Views: 89
Reputation: 5525
None of the other answers seem to have mentioned this enough but a key part of what you need is a trigger.
A trigger allows you to update/insert multiple tables when a condition is met on your original table, in this case the condition would be inserted
Couple this will a linked server and it should be fairly stright forward to achieve what you need.
Upvotes: 0
Reputation: 10680
As an alternative to using Linked Servers as suggested elsewhere, there are various other options depending on your replication requirements:
These alternatives help you replicate data at the database level rather than at the application level (you will need custom code, triggers, etc. when replicating data using Linked Servers).
Upvotes: 2
Reputation: 1095
I have done this in the past with good results:
Use the SQL Linked Server functionality to link the servers. (How to create the linked server for SQL Server 2008 where we have the database from 2000 and 2005)
Then make some sort of a job that copies the new rows from the source do the destination tables.
You will need some sort of incremental field (an bigint is usually enough) to know what your last synced row was when you run the job again.
Upvotes: 0