Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to check two tables?

    Hello, everyone:

    I imported a table from a database to another one in same server. How to check if two tables have the same data?

    Thanks

    ZYT

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT * FROM Table1 JOIN Table 2
    ON Table1.Col1 = Table2.Col1
    AND Table1.Col2 - Table2.Col2
    ect
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    This query should return the same result on both tables, if they are the same:

    select sum(cast(checksum(*) as bigint)) from YourTable
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Mar 2003
    Posts
    223
    Hi, blindman:

    If this query return NULL, how about the next? Thanks
    ZYT

    Quote Originally Posted by blindman
    This query should return the same result on both tables, if they are the same:

    select sum(cast(checksum(*) as bigint)) from YourTable

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Null?

    Are you sure there is any data in the table at all?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •