Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

IDENTIFY CHANGES TO TRANSFER IN ANOTHER DBSERVER - DATAWAREHOUSE Expand / Collapse
Author
Message
Posted Tuesday, November 12, 2013 12:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 27, 2013 3:21 AM
Points: 6, Visits: 18
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
Post #1513348
Posted Sunday, January 5, 2014 6:07 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, May 8, 2014 6:43 PM
Points: 57, Visits: 97
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.
Post #1527946
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse