An error 644 or 8646 may be raised during an update or a delete operation on a table that contains a unicode column with a Latin1_General_BIN collation. The error message that you will see in the SQL Server error log is:
Error: 644, Severity: 21, State: 5 Could not find the index entry for RID '1613b1000000100' in index page (1:189), index ID 7, database 'TestDB'.. Error: 8646, Severity: 21, State: 1 The index entry for row ID was not found in index ID 7, of table 2009058193, in database 'test644'..
Assuming you are experiencing the problem described in this article, before you apply the fix provided in this article, running a DBCC CHECKDB statement will not report any errors related to the type of index corruption discussed in this article. These errors are reported after you apply the fix. The CHECKDB errors that you might see after you apply the fix may be similar to:
Server: Msg 2511, Level 16, State 1, Line 1 Table error: Object ID 2009058193, Index ID 7. Keys out of order on page (1:189), slots 184 and 185.
Note This example is specific to an error associated with a non-clustered index. However, this problem also applies to clustered indexes.
After you apply the fix and run DBCC CHECKDB, if you see error messages similar to the one indicated earlier in this article, you must rebuild the index on the table indicated in the error message to fix the corruption.
To confirm that the 644 error you are experiencing is related to the problem described in this Knowledge Base article, you can use one of the following two methods:
For this method, follow these steps:
Apply the fix mentioned in this article on a test server.
Back up the production database (the one that is experiencing the 644 index corruption errors), and then restore the backup on the test server.
Run DBCC CHECKDB against this restored database on the test server.
Run DBCC CHECKDB against the same database on the production server.
If CHECKDB on the test server shows errors that do not show up in the CHECKDB results from the production server, then you can deduce that you are experiencing the scenario described in this article.
For this method, follow these steps:
Identify all the tables on the affected database that have an index on a unicode column with Latin1_General_BIN collation.
If such tables exist, run the following query against those tables and see if any rows qualify this query:
DECLARE @i INTSET @i = 1WHILE @i < 32BEGIN SELECT @i, * FROM <TableName> WHERE <IndexedColumnName> LIKE N'%' + nchar(@i) + N'%' SET @i = @i + 1END
If the query results in any qualifying rows, then the possibility of experiencing this scenario is high (but not guaranteed yet).
To confirm that you might be experiencing the problem, run the following DELETE command against the rows that have qualified from the query:
BEGIN TRANDELETE FROM <TableName> WHERE <IndexedColumnName> = <Value>ROLLBACK TRAN
If running the query results in an error 644, then you have identified the index that has experienced the form of corruption described in this article.
After you confirm that you are experiencing the problem described in this article, follow these steps to resolve the issue:
Apply the fix discussed in this Knowledge Base article.
After you apply the fix, run DBCC CHECKDB on the affected database. Doing so should report the index corruption related errors.
These error messages will give you information about the index that is corrupted. You can use this information to rebuild the affected indexes.
Service pack information
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 How to obtain the latest SQL Server 2000 service pack
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.