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)
 [:I] Copying fields

Author  Topic 

pkpzt94
Starting Member

3 Posts

Posted - 2005-12-12 : 10:58:52
I am trying to use DTS designer to copy one field from one table to another matching them to the keyid that matches in both but confused. I know how to copy over all the fields as new entries but how do I just copy over the ones that match and not double the number of records?



---------------
nc-ghost

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-13 : 01:36:03
Insert into tagetTable(columns)
Select Columns from sourceTable T where not exists(select * from targetTable where keycol=T.keycol)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -