Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


IDENTIFY CHANGES TO TRANSFER IN ANOTHER DBSERVER - DATAWAREHOUSE


IDENTIFY CHANGES TO TRANSFER IN ANOTHER DBSERVER - DATAWAREHOUSE

Author
Message
registrazioni 75612
registrazioni 75612
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
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
Christian Graus
Christian Graus
Valued Member
Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)Valued Member (57 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search