IDENTIFY CHANGES TO TRANSFER IN ANOTHER DBSERVER - DATAWAREHOUSE

  • SQLServer2005 EE.

    Morning all,

    I need to identify records that are changed since 'last time' (e.g. 1 day ago).

    I thinking about 2 way:

    1) a trigger that update a field every time changed happened (how to identify delete?);

    2) a trigger that write in a table the TABLE_NAME, the primary key value, and date of event;

    Can you suggest me the best way?

    (I need to create CSV and for another project I need to transfer data to PostgreSQL)

    Thank you.

    Max

  • The best way to do a history of changes IMO is a seperate table that identifies all changes, inserts, updates, and deletes, and stores old and new data. It depends on how granular you need it, is primary key, a list of columns changed, the old and new values, enough ?

    As for deletes, the other possibility is always to use a deleted flag, so no data is deleted, then it's essentially an update. That's a pretty wide change on an existing DB, though.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply