Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2009
    Location
    Yemen
    Posts
    6

    Unanswered: can i perform integrity test between 2 DBs

    hi there.. how r u all doin?
    i'm just starting with digging deeper in the DBCC world and i can came across an article about just fixing/replacing the corrupted page and i did that on my test DB but now i want to compare the DB i fixed against the original corrupted DB. is there any script available to do that?


    cheers



    ps: i'm not that good dealing with DBs, i just started working with DBs.

  2. #2
    Join Date
    Sep 2009
    Location
    Yemen
    Posts
    6
    i managed to find this code
    Code:
    EXECUTE sp_msforeachtable 'execute sp_spaceused [?]'
    that helped me to find the details of each table
    http://sql-programming.net/gfx/sp_spaceused-example.png

    and i was windering if there's a function that helps me to check the integrity of the two DBs data wise

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by cool disel
    i managed to find this code
    Code:
    EXECUTE sp_msforeachtable 'execute sp_spaceused [?]'
    that helped me to find the details of each table
    http://sql-programming.net/gfx/sp_spaceused-example.png

    and i was windering if there's a function that helps me to check the integrity of the two DBs data wise

    OK, what do you mean by that?

    Like is all the data in db1.table1 the same as in d2.table1?
    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.

  4. #4
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    You can BCP both out to a text file(s) and diff them.

  5. #5
    Join Date
    Sep 2009
    Location
    Yemen
    Posts
    6
    Brett Kaiser
    --------------------------
    in our company we hv a huge database and each branch has its own DB.
    in the HQ we don't hv any problems with DB but in the branches sometimes we hv some DB errors so they send it to us and we try to fix it.. so what i want to do is after i fix the DB i want to see how much difference between the original DB they sent to us and the one i fixed so we can determine if they can use the DB or they hv to fill up the missing records...

    ps: we do hv daily backups but in most scenario the backup without errors is old
    *****************************

    PMASchmed
    -----------------------
    the DB is huge and ive never BCPed a DB..

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Are the db's on the same server?

    SELECT Col1, Col2, ect
    FROM db1..table1
    UNION ALL
    SELECT Col1, Col2, ect
    FROM db2..table1
    GROUP BY Col1, Col2, ect
    HAVING COUNT(*) = 1

    This will show you all the differences
    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.

  7. #7
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    I deleted my post.
    Last edited by Wim; 10-01-09 at 08:08.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  8. #8
    Join Date
    Sep 2009
    Location
    Yemen
    Posts
    6
    Quote Originally Posted by Brett Kaiser
    Are the db's on the same server?

    SELECT Col1, Col2, ect
    FROM db1..table1
    UNION ALL
    SELECT Col1, Col2, ect
    FROM db2..table1
    GROUP BY Col1, Col2, ect
    HAVING COUNT(*) = 1

    This will show you all the differences

    thanx
    the DB we hv here has more than 90 tables and some tables has around 40 columns...
    i found a software that would do DB comparison and data comparison
    its called
    SQL PROFESSIONAL TOOLBELT

  9. #9
    Join Date
    Oct 2009
    Posts
    1

    Hi

    The best that go together.

    Take that, you sweet thing!

    Life is too short to be serious, laugh it up.

  10. #10
    Join Date
    Sep 2009
    Location
    Yemen
    Posts
    6
    Quote Originally Posted by satsmisus
    The best that go together.

    Take that, you sweet thing!

    Life is too short to be serious, laugh it up.
    i'm not sure that we are on the same train of thoughts with u

Posting Permissions

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