SQL Server Internal Inconsistency on GROUP BY 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.