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)
 Urgent Pls:Copying tables

Author  Topic 

venkath
Posting Yak Master

202 Posts

Posted - 2006-06-06 : 02:55:25
Hi guys

I have two same tables in two different servers in which one table is having complete data where other one is lacking some records.

How can i copy the data from Table with full records to table with missing records.

Thanks in advance.





jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-06-06 : 03:45:21
in enterprise manager, right click the table, all tasks, export data and follow the onscreen instruction, saving to a results table on the destination database

this will serve as your staging table

then you can

insert into targetTable(fields....)
select fields... from results
where resultsPK not in (select PK from targetTable)

HTH

--edit
if they should be identical, just overwrite the targetTable with your sourceTable


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

- Advertisement -