views:

605

answers:

1

I have a SQL Server 2005 database that could only be restored using

Restore Database The_DB_Name
From Disk = 'C:\etc\etc'
With Continue_After_Error

I am told the source database was fine. The restore reports

Warning: A column nullability inconsistency was detected in the metadata of index "IDX_Comp_CompanyId" (index_id = 2) on object ID nnnnn in database "The_DB_Name". The index may be corrupt. Run DBCC CHECKTABLE to verify consistency.

DBCC CHECKTABLE (Company)

gives

Msg 8967, Level 16, State 216, Line 1 An internal error occurred in DBCC that prevented further processing. Contact Customer Support Services.

Msg 8921, Level 16, State 1, Line 1
Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system table is inconsistent. Check previous errors.

Alter Index IDX_Comp_CompanyId On dbo.Company
Rebuild

gives me

Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:77467; actual 45:2097184). It occurred during a read of page (1:77467) in database ID 20 at offset 0x00000025d36000 in file 'C:\etc\etc.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

How much trouble am I in?

+3  A: 

A corruption in an index is not nearly as bad as a corruption in the base table as an index can be rebuilt.

Compare the table and index definitions between the source and destination databases. Check the version of both servers as well. (was the backup automatically upgraded when restored to your server) Drop and recreate the index and rerun the CheckTable.