Error 1509



Message text

Row compare failure


This error occurs when Adaptive Server compares two rows during a sort and the compare fails because a row was being compared against itself.

Error 1509 can occur during normal processing or when you try to create an index on a table and the operation fails because of data corruption or an Adaptive Server problem.

This is a serious error as it indicates possible corruption.


  1. Run dbcc checktable and dbcc tablealloc on the table being accessed at the time of the error to check for corruption.

  2. If there is no corruption, call Sybase Technical Support.

  3. If there is corruption, refer to the write-ups in this manual for other error messages that appear. Run dbcc checktable and dbcc tablealloc again to determine whether the corruption has been cleared.

  4. If corruption still exists after eliminating all error messages, copy your data out and back in using the procedure in “Rescuing data from a corrupted table” in Troubleshooting and Disaster Recovery, or restore your database from clean backups using the procedure below.

    WARNING! Some data might be lost on this page if you recover your table using bcp or select into (that is, the corrupted row and rows following it might be truncated and contain the wrong keys). Compare the two tables (old and new) row by row (by joining them on a primary key, for example) to determine which rows are different (corrupted).

If you choose to restore your database from clean backups, do the following:

  1. Drop the database. If the drop fails, follow the instructions in “Dropping a database when drop database fails” in Troubleshooting and Disaster Recovery.

  2. Create a database for load. Make sure the database you create has sizes as least as large as those in sysusages for the original database (and that all other sysusages values match the original values). For more information about creating a database to load, refer to “create database” in Reference Manual: Commands.

  3. Load the database from backup. Refer to “load database” in Reference Manual: Commands.

  4. Run the online database command to make the database available for use.

Additional information

If you need to call Sybase Technical Support, have the information ready that is listed in “Reporting errors”, including the output from dbcc checktable, dbcc tablealloc, and sp_configure.

Versions in which this error is raised

All versions