Rebuild Index Failed - SQL Server 2000
Microsoft SQL Server

sudhakar
Rank1
Rank1
Posts: 6
Joined: Wed Jun 09, 2010 9:25 am

Rebuild Index Failed - SQL Server 2000

by sudhakar » Sun Jun 13, 2010 11:36 am

Hi,

While running the rebuild index on the database it is getting failed with below error message.

Rebuilding indexes for table 'XXXXX' [Microsoft SQL-DMO (ODBC SQLState: 23000)] Error 1505: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 1. Most significant primary key is 'type 24, len 16'. [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.

Please guide me how to simulate this error and resolve.

ManU
Founder
Founder
Posts: 98
Joined: Sat Sep 26, 2009 9:57 am
Location: India

Re: Rebuild Index Failed - SQL Server 2000

by ManU » Mon Jun 14, 2010 10:07 am

Hi Sudhakar,

Duplicate key in your database produces the issue. So it is the issue related to the data in your database and can't say as a database issue.

You may find rows with duplicate id's from the following procedure

Do like:

Code: Select all

select id, count(id) from "name"

group by id

having count(id) > 1


Create the UNIQUE index and thereby solve the issue.
Thanks
MANU PHILIP
Microsoft MVP(Exchange Server)
| MCITP | MCTS | MCSA | ITIL V3 |
TechNet Forums Profile: ManU

Users browsing this forum: No registered users and 1 guest

It is currently Mon Oct 23, 2017 11:34 am