Error 2513

Troubleshooting SQL Server

Troubleshooting

Error 2513

Severity Level 16
Message Text

Table error: Object ID %ld (object '%.*ls') does not match between '%.*ls' and '%.*ls'.

Explanation

This error occurs when the DBCC CHECKCATALOG statement detects a database object in one system table and the object is not expected in another table. Most often, this occurs when one or more rows in the syscolumns, syscomments, sysindexes, or sysdepends tables have no corresponding rows in sysobjects. This error can also occur if an operation affecting the system table, such as deletion of a user table, was interrupted.

Action

Although this error seldom interferes with database use, it is a good idea to restore the affected system table.

Warning  Severe problems can result from the direct manipulation of the system catalogs. Do not modify the system catalogs unless instructed to do so by your primary support provider.

Follow these steps to restore the consistency of the system tables:

  1. Display the offending rows by executing a query in the problem database against the two tables mentioned in the message. For example, if the message reports one or more mismatches between syscolumns and sysobjects:
    USE master
    GO
    SELECT * FROM syscolumns 
    WHERE syscolumns.id NOT IN
        (SELECT sysobjects.id FROM sysobjects)
    
  2. Enable updates to system tables by enabling the allow updates configuration option.

    Before modifying any system catalogs, be sure that you have a valid backup of the database. For more information about backup operations, see Backing Up and Restoring Databases.

    Warning  Incorrect modification of the system catalogs can result in database corruption or data loss.

  3. Make sure that the rows displayed in Step 1 correspond to reported 2513 errors, and then delete them from the first table mentioned in the message text.

  4. If the number of rows affected by the delete does not match the number found in Step 1, roll back the transaction. If the numbers match, commit it.

  5. To confirm that the mismatches are fixed, re-execute DBCC CHECKCATALOG. Then, disable the allow updates configuration option.

See Also

BEGIN TRANSACTION

CHECKPOINT

Errors 2000-2999

Setting Configuration Options

Using Startup Options