Solved

Rebuild Index on SQL 2000 Database fails due to duplicate key found - how to resolve?

Posted on 2014-09-26
3
122 Views
Last Modified: 2015-01-09
I have a SQL 2000 database that is throwing a lot of errors after a checkdb. I've attempted to run a CHECKDB Repair_Rebuild which failed. Here are the first 30 or so lines of the log:

Server: Msg 1505, Level 16, State 1, Line 1
CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 1. Most significant primary key is '95556616'.
Server: Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. Page (1:15544819) is missing a reference from previous page (1:15544816). Possible chain linkage problem.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. The previous link (1:6231350) on page (1:15774924) does not match the previous page (1:15776528) that the parent (1:9225193), slot 71 expects for this page.
Server: Msg 8937, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. B-tree page (1:15774924) has two parent nodes (0:1), slot 0 and (4:4173), slot 4.
Server: Msg 8937, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. B-tree page (1:15774925) has two parent nodes (1:9540125), slot 98 and (1:9225193), slot 1.
Server: Msg 8937, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. B-tree page (1:15774926) has two parent nodes (1:9540125), slot 97 and (1:9225193), slot 1.
Server: Msg 8937, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. B-tree page (1:15774927) has two parent nodes (1:9540125), slot 101 and (1:9225193), slot 1.
Server: Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 741577680, index ID 1. Page (1:15776528) is missing a reference from previous page (1:15774925). Possible chain linkage problem.
DBCC results for 'MyTable'.
        Repairing this error requires other errors to be corrected first.
        Repairing this error requires other errors to be corrected first.
        Repairing this error requires other errors to be corrected first.
        Repairing this error requires other errors to be corrected first.
        Repairing this error requires other errors to be corrected first.
        Repairing this error requires other errors to be corrected first.


I don't understand how it's possible that a unique index can have duplicate keys - shouldn't SQL have refused the insert since it wasn't unique?

How can I get this index rebuilt?
0
Comment
Question by:KThrace
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
ste5an earned 500 total points
ID: 40346379
Nope, due the problems reported by CHECKDB, data corruption has occured. Thus the only way is to rebuild this table.
0
 

Author Comment

by:KThrace
ID: 40346397
Understood. Which involves exporting the data, recreating the table, and then importing the data.

Am I not then going to run into problems with the non unique values? I still don't understand how duplicate keys got into the table...
0
 
LVL 32

Expert Comment

by:ste5an
ID: 40346727
The corruption may have affected the primary key. Thus bypassing the uniqueness check. Anorher possible reason: the corruption created the duplicate valuė.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now