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 |
|
hshung
Starting Member
2 Posts |
Posted - 2004-03-11 : 04:16:25
|
| HiI use SQL server 2000 DTS to copy DatabaseA TableA to DatabaseB TableB every day.Can I only copy the updated or new data from TableA to TableB ?How to do it ?Thanks for any help!Hung |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-03-11 : 04:47:51
|
| Easiest way is to put a timestamp on TableA, save the last value transferred and transfer data with values greater.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2004-03-11 : 15:47:20
|
| ...or if you have an identity-field you could do something like this:INSERT INTO tableBSELECT * FROM tableA WHERE ID > (SELECT MAX(ID) FROM tableB) |
 |
|
|
hshung
Starting Member
2 Posts |
Posted - 2004-03-11 : 22:37:28
|
| Thanks Lumbago & nr.I can use : Select * from TableA where not ID in (Select ID from TableB)to find the new records.But my problem is how to find the updated records in TableA ?It is not allowed to modify TableA because it is not my DataBase.Hung |
 |
|
|
|
|
|