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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS - copying table data

Author  Topic 

shaharru
Yak Posting Veteran

72 Posts

Posted - 2004-10-31 : 10:46:15
hi all,

i have a dts that copies table contents from remote server to local server.
remote table:
ItemID|name
1 |name1
2 |name22
3 |name33

local table:
ItemID|name
1 |name1
2 |name2

i want that the dts will only copy the new rows( aka. row with ItemID = 3) and leave the other rows as they are.

can any one help me create such a dts.


please!

nr
SQLTeam MVY

12543 Posts

Posted - 2004-10-31 : 13:38:29
There are options:
Copy all data to the local server then insert the rows that are not already there.
Copy the PK of all data from the local server to the remote server then copy back rows that aren't there
Copy the PK of all data from the remate server thgen copy the data for rows that aren't there.
Have something on the remote server (timestamp col, inserted date col) so that you can tell what has not been copied.

None of this has anything to do with dts. Decide first how you want to decide what to transfer (will depend on the data sizes and what access you have) then you can decide on the method of implementation.
Also take into account what may need to happen in the future e.g. catering for deletes, updates, batch updates of source table, transfer from multiple sources...

==========================================
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.
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2004-10-31 : 13:44:44
If you can link the servers, you can write SQL to do this.

rockmoose
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-11-01 : 23:25:12
in your dts wizard, instead of selecting objects, specify query

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -