June 27, 2011 at 2:51 am
I tried reindexing a table...but below error is coming
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 '11056'.
The statement has been terminated.
i tried checking the duplicates but nothing is there
Service pack is SP4
June 27, 2011 at 2:54 am
try going thru this lms
http://www.sqlservercentral.com/Forums/Topic159966-54-1.aspx
June 27, 2011 at 7:29 am
I tried the below steps
1. Drop the index, Primary Key
2. Run the script to find duplicates (found duplicate records)
3. Delete the duplicate rows
4. Rebuild the index.
But i got confused by these duplicate records, having primary key how duplicate record got inserted into this table? It should thrown errors while inserting right?
June 27, 2011 at 9:18 am
You are not deleting the duplicate records or you would not be getting the error.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 27, 2011 at 1:29 pm
Try DBCC CheckDB and see if that is working fine.
Thank you.
Aatish Patel
June 27, 2011 at 1:36 pm
Sounds like you need help identifying and deleting the duplicates?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
June 27, 2011 at 3:01 pm
That's a classic sign of database corruption. Please run the following and post the results. Do nothing else.
DBCC CheckDB('<Database Name>') WITH NO_INFOMSGS, ALL_ERRORMSGS
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply