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
 SQL Server Development (2000)
 Comparing rows of two tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-02-27 : 11:59:21
Girish writes "hello... i have two identical tables which contains eactly the same data. i have made some update on the first table. now i want to find the updated rows by comparing the first table with the second table. so what is the best way to find the updated records?

i am using SQL Server 2000 and windows XP.

Hope to get the result soon...

Girish"

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-02-27 : 13:39:53
Something like:

SELECT fields
FROM TableA a
INNER JOIN TableB b ON a.PK = b.PK
WHERE a.field1 <> b.field1

--notes
--TableA is your updated table
--PK is your table primary key
--field1 is one of the fields you updated
Go to Top of Page

activecrypt
Posting Yak Master

165 Posts

Posted - 2006-02-28 : 01:04:54
Hi,
refer below topics.

http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=3746

http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=9589

http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=4308



Andy Davis
Sql Shield Team
--------------------------------------------
SQL Server Encryption Software
http://www.sql-shield.com
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-28 : 01:14:38
Also refer
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 -