Error 2517

Severity

16

Message text

Table Corrupt: Procedure id %ld (procedure name = %S_OBJID) does not match between %.*s and %.*s

Explanation

This error occurs when dbcc checkcatalog finds that an entry for a compiled object (for example, a stored procedure or trigger) exists in the table sysprocedures and that entry does not exist in the sysobjects table.

Action

  1. If the error occurred on an object in sysprocedures in master, enable updates to system tables:

    1> use master
    2> go
    
    1> sp_configure "allow updates", 1
    2> go
    
  2. Determine how many rows contain the object entry:

    1> use <database_name>
    2> go
    
    1> select * from sysprocedures
    2> where id = <procedure_ID>
    3> go
    

    Where <database_name> is the name of the database that contains the table with the object and <procedure_ID> is the ID of the procedure in the 2517 error.

  3. If you need to recover the stored procedure, retrieve the stored procedure’s text:

    1> sp_helptext <stored_proc_name>
    2> go
    
  4. Remove the object entry from sysprocedures:

    1> begin transaction
    2> delete sysprocedures
    3> where id = <object_ID>
    4> go
    

    Where <object_ID> is the ID of the procedure in the 2517 error.

  5. Check the results carefully, and commit the transaction only if the update affected the expected number of rows. If the update affected more than the expected number of rows, roll back the transaction. To commit the transaction, type:

    1> commit transaction
    2> go
    
  6. Disable updates to system tables:

    1> sp_configure "allow updates", 0
    2> go
    
    1> checkpoint
    2> go
    
  7. Run dbcc checkcatalog again to verify that the problem is corrected. If the object entry still exists in other tables, you may get other error messages (such as error 2513). If you do receive other errors, follow the directions in this manual for handling those errors.

  8. If you wanted the object that has been deleted, re-create it using the information that you obtained in step 3.

Versions in which this error is raised

All versions