How to copy distinct records from one table to another using SQL 2005

Reply

Join Date: Sep 2007
Posts: 1
Reputation: seharmks is an unknown quantity at this point 
Solved Threads: 0
seharmks seharmks is offline Offline
Newbie Poster

How to copy distinct records from one table to another using SQL 2005

 
0
  #1
Oct 24th, 2007
I have a table on an offline database having let say 2000 rows and same table on an online database with let say 3000 rows. Now I want to copy just those records (1000) from online database that are not in the offline database table. Also, both tables have same name, same schema etc.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 645
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 17
binoj_daniel's Avatar
binoj_daniel binoj_daniel is offline Offline
DaniWeb Expert

Re: How to copy distinct records from one table to another using SQL 2005

 
0
  #2
Oct 24th, 2007
What are the keys in the table?
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: How to copy distinct records from one table to another using SQL 2005

 
0
  #3
Oct 24th, 2007
Use differential Backup...
or you can use insert select
like
  1. INSERT INTO table1 VALUES (SELECT DISTINCT a,b,c.. FROM table2)
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC