Skip navigation

How can I fix a corruption in a system table?

A. A. If the problem can be fixed with an index re-create, then there is a system stored-procedure to do this.

sp_fixindex <db_name>,<system_table_name>,<index-id>
e.g. sp_fixindex pubs,sysindexes,2

You can also issue the relevant dbcc command directly if sp_fixindex refuses to attempt the fix - e.g. for a non-clustered index on sysobjects

DBCC DBREPAIR(dbid, REPAIRINDEX, sysobjects, 2)

It is not possible to rebuild the clustered index on sysindexes or sysobjects.

If the above do not work, then the only choice is to create a new database and then use the transfer tools in SQL EM to copy the good data and objects across.


TAGS: SQL
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish