Dependent on the database in question, you may find that table sizes may not actually be the same for the same data on different machines. In particular, PostgreSQL (which I'm most familiar with) may have different amounts of unused space on each machine, dependent on how recently VACUUM has been run.

Assuming you're checking the data (rather than the schema), I'd be tempted to take a data-only dump of each table (using the same backup mechanism on all 4 machines), calculate an MD5 hash for each dump, then compare those. If you're dealing with large amounts of data this may not be particularly feasible, and this almost certainly won't work if the machines aren't all the same architecture.

I've no idea if this is the best way of doing this, but it's what sprung to mind - am very curious to see the other replies to your question to be honest ;-)

Update: I can't believe I missed the glaringly-obvious 'MS SQL' in the title. More coffee required for me. I still think the MD5 approach is worth considering mind you.


In reply to Re: Automated checking for identical MS SQL tables by john_oshea
in thread Automated checking for identical MS SQL tables by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.