Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Duplicate key Expand / Collapse
Author
Message
Posted Thursday, January 14, 2010 4:04 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, October 21, 2010 1:18 PM
Points: 71, Visits: 380
I have just dropped the index for a table in my DB,and when i create newly it says as :
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.tblone' and the index name 'PK_one'. The duplicate key value is (5635879).

How to resolve this
Post #848019
Posted Thursday, January 14, 2010 6:23 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, December 11, 2014 6:43 PM
Points: 2,838, Visits: 8,570
Was the original index unique ?
Can you show us the script for the index before you dropped it, and the script for the new index ?



Post #848045
Posted Thursday, January 14, 2010 6:27 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, November 24, 2014 3:43 AM
Points: 247, Visits: 3,869
Hi there,

Between the drop of the index and the creation of the index was there any activitie on the table?

You can identify the duplicated records by performing the folloing query

SELECT <List of columns included in the Unique INDEX>, count(*) 
FROM dbo.tblone
GROUP BY <List of columns included in the Unique INDEX>
HAVING COUNT(*) > 1

José Cruz
Post #848047
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse