Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to build a database that contain only the delta from yesterday by comparing two databases, finding out the following:

  • What rows were Inserted
  • What rows were Deleted
  • What rwos were Updated

How can I do this ?

share|improve this question
Pls anyone can help?? – user36146 Mar 25 '14 at 12:09
Does all your tables have date time column? There is no easy way of doing it natively unless you use third party software or open source software. Also, when you say delta between 2 databases, do you want to load the changes in the 2nd one ? – Kin Mar 25 '14 at 12:24
Do you want to find out what was inserted, updated, and deleted (set up a trigger on each table to log the action (I/D/U), DATETIME2 it happened, and the unique key affected to a history table - and the user, application, hostname, etc. if you like)? Or do you want to find the differences between every shared table in two databases (which may not have the same tables, or the same columns, or the same column defintions, etc.), in which case some (LEFT) OUTER JOINs on unique indexes on NOT NULL columns are in order, as well as comparing every field in every row that INNER JOINs match. – Anti-weakpasswords Mar 28 '14 at 4:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.