RSS Forums RSS

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

Please support our MS SQL advertiser: Programming Forums
Reply
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

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Posts: 638
Reputation: binoj_daniel is an unknown quantity at this point 
Solved Threads: 16
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

  #2  
Oct 24th, 2007
What are the keys in the table?
Reply With Quote  
Posts: 1,859
Reputation: Ramy Mahrous has a spectacular aura about Ramy Mahrous has a spectacular aura about 
Solved Threads: 213
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Posting Virtuoso

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

  #3  
Oct 24th, 2007
Use differential Backup...
or you can use insert select
like
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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 8634 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:17 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC