Sunday, February 12, 2012

check values record by record

Consider this scenario.

I have two database in the sql server and consider that i have a query which has 4 tables inner joined.

When i execute the query in the database1 , the query is returning rows, But when i execute the same query in the database2, the query is not retuning rows . I know that the

no rows are returned because of missing data in the database2. But have no idea how to trace what values are missing in the database2. Please note the tables is having a huge

list of records by which manually comparison is painfull. Please consider i dont have any background idea of the values in the tables but just using it. Any help would be

appericated.

I have used the third party tool called sql server comparison tool which gives me the desired result.

http://www.sql-server-tool.com/?src=dtc#nd0

|||

SELECT *

FROM database1.dbo.MyTable

EXCEPT

SELECT *

FROM database2.dbo.MyTable

|||

This EXCEPT command is giving error in sql 2000 . will it work in sql 2005

No comments:

Post a Comment