Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
evrimagha
Starting Member
5 Posts |
Posted - 2009-07-15 : 17:56:17
|
HiI am working on a database (A) that gets replicated from another database (B) every night to get new data. I have another database (C) that uses a different structure, but the same data as A. My question is, every night after replication on A is done, how can I run a query to get me only those updated rows from each table?Many many thanksEvrim  |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2009-07-16 : 02:00:18
|
| Include a Datetime column in each table of Database A , then run a query and update in C DbSenthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
erichan
Starting Member
3 Posts |
Posted - 2009-07-16 : 10:39:43
|
| I would suggest a new table to record the ID range (min and max) of each replicated table every day if those tables have a unique and incremental ID column. Alternatively, a datetime column is a possible solution, but only date (rather than time) of replication is saved. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-16 : 12:29:12
|
quote: Originally posted by evrimagha HiI am working on a database (A) that gets replicated from another database (B) every night to get new data. I have another database (C) that uses a different structure, but the same data as A. My question is, every night after replication on A is done, how can I run a query to get me only those updated rows from each table?Many many thanksEvrim 
i think an audit column like datemodified is enough for this. you can simply look for records having this column's value greater than current day. |
 |
|
|
|
|
|