Click here to Skip to main content
15,943,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I came across one of the requirement that is.

--I have two database ABC and XYZ.
--Under Both the DB we have one table Employee(Schema of both the database is same).
--Whenever we insert the record into [ABC].Employee it should be sync with the another database table [XYZ].Employee.
--I have been using Sql server 2008R2 and VS2013 on my production.

I don't want to replicate databases or restore Database.

Do we have any utility or any provision to sync the data in two different database, Please share. Help would be greatly appreciable.

Thanks & Regards,
deepakaitr12345
Posted
Updated 3-Nov-15 22:22pm
v2
Comments
Corporal Agarn 4-Nov-15 6:42am    
This is what replication is used for. Publish the one to the other. If the second is just a backup you could even do log shipping.
That being said if you still do not want to replicate your VS2013 code should replicate the inserts.

1 solution

You can maintain a boolean column sync in the Employee table. Update it to true when the record is updated to [XYZ].Employee.

Also whenever the user changes the existing Employee records in ABC, make sure the column Sync is set to false . So that when you are replicating it will update this record in XYZ using the unique key you have maintained.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900