Take the 2-minute tour ×
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. It's 100% free, no registration required.

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 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 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 at 4:11

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.