1

I have a DBCC check that will always fail with the following error:

Msg 8992, Level 16, State 1, Line 2
Check Catalog

Msg 3853, State 1:
Attribute (referenced_object_id=517752334,key_index_id=1) of row (object_id=660509732) in sys.foreign_keys does not have a matching row (object_id=517752334,index_id=1) in sys.indexes.

I have found the problem where the referenced_object_id is wrong and needs to be changed to 517785102 for FK_SytModuleStat_SytModule.

I can't change it in sys.foreign_keys and I can't drop and recreate the FK_SytModuleStat_SytModule in the SytModuleStat to fix the problem. The only problem is that the FK is no longer correct when I try to modify it, I see that the primary/unique key base and column fields are blank compared to a working one.

I have tried many suggestions with alter, drop create, set emergency etc. But I can't fix this one key!

I have tried to connect with DAC in single user mode and it won't let me enable ad hoc updates even with the reconfigure overrride option. I get this error:

Ad hoc updates to system catalogs are not allowed.

DBCC repair with data loss won't work, and there doesn't seem to be a repair catalog feature in SQL Server 2014 Express Edition.

0

1 Answer 1

1

If your user tables are readable, use the Copy Database Wizard selecting the "SQL Management Object method" to copy your objects to a new database. After verifying the data and security in the new databases, backup and drop the old one and rename the new one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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