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
 General SQL Server Forums
 New to SQL Server Programming
 difference between tables

Author  Topic 

klace06
Starting Member

1 Post

Posted - 2007-01-05 : 06:50:11
Hi im trying to find the difference between 2 silmilar tables in sql 2000. 1 table has 279,042 records and the other has 279,003 records, I ideally want to difference so to enable me to merge the two tables
I would really appreciate any help

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-05 : 07:39:10
You can make use of FULL OUTER JOIN.

Something like:

select t1.*, t2.*
from Tbl1 t1
FULL OUTER JOIN Tbl2 t2
on t1.col1 = t2.col1 and t1.col2 = t2.col2 and ...
Where t1.col1 is NULL or t2.Col1 is NULL or ....


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-01-05 : 07:49:30
or

http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -