Error 2626

Severity

22

Message text

Illegal attempt to insert duplicate key row in the clustered index for object ’%.*s’ in database ’%.*s’.

Explanation

Error 2626 is raised when you attempt to insert a row into a table with a clustered index, and the key value being inserted matches an existing index key value, which was unexpected.

Error 2626 can be caused by:

Action

Corrective action depends on the type of table, and whether the table is partitioned. If the problem persists after applying the correction, call Sybase Technical Support.


Tables with more than one partition

  1. Unpartition the table:

    1> alter table <table_name> unpartition
    2> go
    

    Where <table_name> is the object named in the message text.

  2. Repartition the table:

    1> alter table <table_name> partition <number_of_partitions>
    2> go
    

Tables with one partition

  1. If the object encountering the error is a system table, perform the procedure in “Fixing a system table corrupted index” in the Troubleshooting and Disaster Recovery guide to repair the index. Then go to step 5.

  2. If the object encountering the error is a user table, identify the clustered index on the table:

    1> sp_helpindex <table_name>
    2> go
    

    Where <table_name> is the object named in the message text.

  3. To ensure that the information needed to re-create the index is available, run sp_helpindex on the index prior to dropping it.

  4. Drop the index, then re-create the index, or create a non-clustered index. This eliminates the 2626 error in most cases.

  5. Run dbcc checktable on the table to verify that the corruption is gone.

Versions in which this error is raised

All versions