DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   How to copy distinct records from one table to another using SQL 2005 (http://www.daniweb.com/forums/thread94112.html)

seharmks Oct 24th, 2007 6:00 am
How to copy distinct records from one table to another using SQL 2005
 
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.

binoj_daniel Oct 24th, 2007 11:24 am
Re: How to copy distinct records from one table to another using SQL 2005
 
What are the keys in the table?

Ramy Mahrous Oct 24th, 2007 10:54 pm
Re: How to copy distinct records from one table to another using SQL 2005
 
Use differential Backup...
or you can use insert select
like
insert into table1 values (select distinct a,b,c.. from table2)


All times are GMT -4. The time now is 7:53 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC