?
Solved

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

Posted on 2014-09-26
3
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
ste5an earned 2000 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 35

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

752 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