943,717 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 12374
  • MS SQL RSS
Oct 24th, 2007
0

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

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seharmks is offline Offline
1 posts
since Sep 2007
Oct 24th, 2007
0

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

What are the keys in the table?
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Oct 24th, 2007
0

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

Use differential Backup...
or you can use insert select
like
MS SQL Syntax (Toggle Plain Text)
  1. INSERT INTO table1 VALUES (SELECT DISTINCT a,b,c.. FROM table2)
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: How to Insert, Update and Delete objects in Active Directory
Next Thread in MS SQL Forum Timeline: SQL Server newbi... how to get started??





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC