D
D
Denis Sentyabov2015-06-09 18:42:02
SQL
Denis Sentyabov, 2015-06-09 18:42:02

How to make a differential copy of a MS SQL table?

There is a table X, it is completely cleared every 3 days, tell me how to make it so that only the data that has changed from it can be copied to another table and so fill the table, Get a deeper storage period.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim Shandrinov, 2015-06-09
@suguby

I'm not familiar with MS, but the general solution is this: hang a trigger that will update the special modified_at field of the DATETIME type on the row insert and update with the current time.
Then it will be possible to filter by this gender all records that have been changed/inserted during the period.

B
Barada, 2015-06-10
@Barada

Variant Vadim Shandrinov is good. If you don't have access to schema changes, etc., you can use Cross-Database Queries . Compare there inserted or not yet. It will work many times slower than the option with a trigger.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question