• terry999 (5/2/2016)


    Hi

    I got this error on a scheduled integrity check. SQL 2005 sp2

    Data row does not have a matching index row in the index '' (ID 2). Possible missing or invalid keys for the index row matching:

    The corrupted index is a non-clustered Unique index on a VIEW.

    I rebuild both the clustered index on the view and the corrupted index.

    It fixed the problem.

    I'm trying to find what caused the corruption.

    1. Windows Event viewer shows nothing

    2. SQL Error Log shows no error.

    I'm surprised the DB was not being used in the period it failed (weekend).

    Any ideas?

    Logging and the event viewer could shine some light on this but that depends on what's logged and for how long. Many things can cause corruption.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001