data corruption

  • I have a table A with a cluster index on the primary key

    That table is linked to another table B that is linked to table C

    Table C has a noncluster index on the primary key which was set to be noncluster by mistake.

    Now I am having an issue with table A

    When I insert a new record in A say id=33885 and this is the last one

    I select top1 * from table A order by id desc

    I do not get that id I get another one much smaller than this one

    When I click rebuild for the index

    and try it again I get the id 33885

    Then after a few minutes later I get the same problem

    How to check whether the index is corrupted or not and how to fix that

    I want to drop and rebuild the non cluster index as cluster and drop and rebuild all the foreign keys pointing to section id

    but now What shall I do with this key that I am having an issue with

    i.e. If I ran Use [Your database name]

    DBCC CheckDB

    will it show what is wrong can I run this command while people are using my site do I need a lot of disk space to do that.

    Thanks

  • That is not data corruption. Database corruption would give you high-severity errors, not wrong results.

    Post table definition, post exact query.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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