tag:blogger.com,1999:blog-16771259.post114780311530389547..comments2024-03-07T03:02:45.934-08:00Comments on SQL Server Code,Tips and Tricks, Performance Tuning: SQL Compare Without The Price TagUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-16771259.post-46148754349962796152009-07-16T06:09:46.750-07:002009-07-16T06:09:46.750-07:00Great script. Thanks for posting.
GopalGreat script. Thanks for posting.<br /><br />GopalAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-16771259.post-1147884243041996332006-05-17T09:44:00.000-07:002006-05-17T09:44:00.000-07:00Thanks Louis, I have added a technicolor version o...Thanks Louis, I have added a technicolor version of your code to the original post ;-)Denishttps://www.blogger.com/profile/13745938552201273794noreply@blogger.comtag:blogger.com,1999:blog-16771259.post-1147845722473876132006-05-16T23:02:00.000-07:002006-05-16T23:02:00.000-07:00great blog and nice idea... One thing you can do i...great blog and nice idea... One thing you can do is combine all of the queries into a single query using FULL OUTER JOIN (hopefully the formatting won't be too horrible, it looks horrible in this little window for this comment :)<BR/><BR/>SELECT case when t1.au_id is null and t2.au_id is not null <BR/> then 'Does Not Exist On Production'<BR/> when t1.au_id is not null and t2.au_id is null <BR/> then 'Does Not Exist In Staging'<BR/> else 'Data Mismatch' end,<BR/> coalesce(t1.au_id, t2.au_id) as au_id<BR/>FROM (select *, binary_checksum(*) as bc from pubs..authors) as t1<BR/> FULL OUTER JOIN (select *, binary_checksum(*) as bc from tempdb..authors2) as t2 <BR/> ON t1.au_id =t2.au_id<BR/>where t1.au_id is null<BR/> or t2.au_id is null<BR/> or t1.bc <> t2.bcAnonymousnoreply@blogger.com