tsql - Comparing Query Changes. Is there a better way -


when writing queries, in steps. sometimes, in process realize i've made "mistake" such ending or losing records. so, typically compare 2 queries so:

(select blah blah blah ) mine  inner join  ((select blah blah blah ) orig mine.pk <> orig.pk 

or if i'm looking missing or records use left join instead , nulls.

is there better way figure out why 2 queries returning different numbers of records?

you need full join start with. inner join show records in mine not in orig. full join show in orig , missing in mine.

a quick , dirty way check differences compare result of checksum_agg(checksum(*))


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -