Compare data of two tables

  • S_Kumar_S

    SSCrazy Eights

    Points: 9004

    Comments posted to this topic are about the item Compare data of two tables

    Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.

  • timothyjultican


    Points: 4

    Why not generate a hash byte and compare the two tables based on the join condition?

  • Thomas Franz

    Hall of Fame

    Points: 3647

    CHECKSUM(*) or BINARY_CHECKSUM(*) could be an option but this needs all columns in the same order and (sometimes) equal data type.

    Beside of this the function may work or a good starting basis, but has several flaws (e.g. no support for NULL columns; using the old INFORMATION_SCHEMA instead of the sys-schema; being not really well formated; no comments; using a global temporary table; not even trying to escape the table and column names (QUOTENAME() is your friend))...

    God is real, unless declared integer.

  • Bill Galashan

    SSChasing Mays

    Points: 623

    Also what about the Microsoft supplied tablediff! While BOL indicates this is a utility for comparing replicated tables it works quite nicely on any pair or table regardless of the method of the table duplication. Granted there are some bugs in early version of the utility but you can run newer version of the exe against older version of sql server

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply