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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Compare two table

Author  Topic 

acdacd
Yak Posting Veteran

63 Posts

Posted - 2005-08-16 : 06:27:18

I have two independent table,

If I want to know whether all row of same col in one table is same as another table
Eg
Table A tabl\B
a a
b b
c c
Return True/1/sth like this

My method is
select @temp = (select Count(*) From tableA A, tableB B where A.Col = B.Col)
select @temp2 = (select Count(*) From tableA A)
Then I compare both temp variable

Is there any other ways/or one query to do it?



be a hardworking people!!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-16 : 06:31:34
Refer this also
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 -