I've got a quick question , that would be great if anyone can help me with this problem:
I have 2 SQL 2012 databases A & B , they are both Identical same tables and same structures as well.
Data is inserted into DB A and on regular schedule I need the data to be inserted into DB B automatically and APPENDS to the existing data in DB B,after that, data in DB A gonna deleted and the whole process starts over again with new records.I couldn't preform this action using any methods of replication because once the data is deleted from DB A same thing gonna happen in DB B.
On the other hand these data contains FK pointing to other tables in the database so if the first problem solves and it starts APPENDING data to the existing data on DB B all these FK should be updated with new values in DB B.
Do you guys have any solution using SQL itself or any other tools?
Sql-server – Appending data to the existing database
sql-server-2012
Related Question
- Sql-server – Copy of a database with an existing database with schema and data in sql server
- Sql-server – fn_dblog not showing up deleted table data
- Sql-server – Move content between filestream containers
- Sql-server – Combining data from multiple rows
- Sql-server – Copy Data between two databases
- Sql-server – Transactional replication using articles filters and delete operations
- SQL Server Trigger – Check for Changes in a Text Column
- Preventing SQL Server Job History Deadlocks – Best Practices
Best Answer
You can use Transactional Replication, but you have to exclude the DELETEs. Just replicate INSERTs and UPDATEs.
Here's a related article.