DBCC CHECK DB errors how to find IDs to match up with table names

Last Post 31 Jan 2011 12:58 PM by gunneyk. 5 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
Markus_SQL
New Member
New Member

--
31 Jan 2011 06:53 AM
I have a SQL 2000 DB that is showing errors for a DBCC CHECK DB.  How do I find the IDs to match up with actual table names...

Missing or invalid key index ID5  or   Data row identified with RID problems.

Does a repair fast delete any data as it suggests that.
rm
New Member
New Member

--
31 Jan 2011 07:06 AM
Should have id and name of each object in sys.objects. In certain cases, rebuild index will solve problems. Can be more clear if possible to post some error messages here.
Markus_SQL
New Member
New Member

--
31 Jan 2011 07:11 AM
Sorry... at first it would not let me cut/paste the errors... I am running a rebuild all indexes for the entire db... I cannot seem to figure out how to match up the IDs to actual object names. [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Table '(Object ID 324208951)' (ID 324208951). Missing or invalid key in index '(Index ID 5)' (ID 5) for the row: [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Table '(Object ID 324208951)' (ID 324208951). Missing or invalid key in index '(Index ID 5)' (ID 5) for the row: [Microsoft][ODBC SQL Server Driver][SQL Server]Data row (1:2569152:49) identified by (RID = (1:2569152:49) ) has index values (DMA_NBR = 678 and FRANID = '102800'). [Microsoft][ODBC SQL Server Driver][SQL Server]Data row (1:2569152:69) identified by (RID = (1:2569152:69) ) has index values (DMA_NBR = 679 and FRANID = '105800'). [Microsoft][ODBC SQL Server Driver][SQL Server]Table error: Table '(Object ID 324208951)' (ID 324208951). Missing or invalid key in index '(Index ID 5)' (ID 5) for the row: [Microsoft][ODBC SQL Server Driver][SQL Server]CHECKDB found 0 allocation errors and 36 consistency errors in database 'AFA_MKIS'. [Microsoft][ODBC SQL Server Driver][SQL Server]repair_fast is the minimum repair level for the errors found by DBCC CHECKDB (AFA_MKIS ).
rm
New Member
New Member

--
31 Jan 2011 07:25 AM
Run 'select name from sys.objects where object_id = 324208951' under that db.
Markus_SQL
New Member
New Member

--
31 Jan 2011 08:33 AM
Thanks for your quick reply. However, I ran a rebuild all indexes job and then another DBCC Checkdb and the db is now reporting zero errors.

-Mark
gunneyk
New Member
New Member

--
31 Jan 2011 12:58 PM
Just for future reference the Object ID is as Ray pointed out or SELECT OBJECT_NAME(324208951). And the Index can be found by select * FROM sys.indexes where [object_id] = 324208951 and indID = 5. That way you can just rebuild that nonclustered index for that table and get back up and running much faster.


Acceptable Use Policy
---