/*
drop table #t1 
drop table #t2

drop table #tc1 
drop table #tc2
*/
create table #t1 ( i int unique, c varchar(10))
insert #t1 values(1, 'abc')
insert #t1 values(12, 'xyz')
insert #t1 values(123, '*mno')
insert #t1 values(2345, 'uvw')

create table #t2 ( i int unique, c varchar(10))
insert #t2 values(1, 'abc*')
insert #t2 values(12, 'xyz')
insert #t2 values(123, 'mno')
insert #t2 values(1234, 'pqrs')


select getchecksum(null) as checksum, i
into #tc1
from #t1

select getchecksum(null) as checksum, i
into #tc2
from #t2

select * from #t1
select * from #t2


select * from #t1
where exists(Select * from #tc1
                where #tc1.i = #t1.i And
                        not exists(select * from #tc2 where #tc2.checksum = #tc1.checksum))

select * from #t2
where exists(Select * from #tc2
                where #tc2.i = #t2.i And
                        not exists(select * from #tc1 where #tc1.checksum = #tc2.checksum))

This page was last updated on May 01, 2006 04:28 PM.