I recently recovered a database from a hard-drive failure using DBCC CHECKDB WITH REPAIR ALOW DATA LOSS.

Now I can select records from a table-valued function to retrieve sales records, but using a GROUP BY on the same data causes an "internal inconsistency" error.

Running DBCC CHECKDB returns zero inconsistency errors.

I have run everything I know to detect any torn pages, but have found none.

How do I find the torn page or force a rebuild?


Basically, you have to restore. Do you have a backup?

While this is restoring, read "Misconceptions around database repair" and the rest of Paul Randal's site.

Harsh, but true.

  • This database has been live for a while since the last backup. The last full backup was made while (presumably) the previous disk was already failing, so won't the backup be suspect too? In other words, won't it be like restoring a backup made in the present state? – Petrus Theron Aug 31 '11 at 22:14

You should be able to look at the page itself using DBCC PAGE and see if the page is still corrupt and what's going on. What version of SQL Server was the backup created with?

  • SQL Server 2008. Not sure of the service pack at the time, if that matters? – Petrus Theron Sep 1 '11 at 10:21
  • The service pack version shouldn't matter. Can you post the full error you get when you are running the query with the group by? – mrdenny Sep 1 '11 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.