• Register
1 vote
64 views

Problem :

I am facing bellow error
the create unique index statement terminated because a duplicate key was found for the object name
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

The problem is not that index already exists but there are duplicate values of the TopicShortName field in the table itself. Such duplicates prevent the creation of a UNIQUE index.

So you should run a query to confirm that you have a duplicate:

SELECT
    TopicShortName,
    COUNT(*)
FROM
    DimMeasureTopic
GROUP BY
    TopicShortName
HAVING
    COUNT(*) > 1

Presumably in the other database the data are different, and the duplicates are not present.

This will certainly solve your problem.

Further Readings :

https://www.ibm.com/support/pages/refresh-fails-create-unique-index-statement-terminated-because-duplicate-key-was-found-error-while-replicating-sql-server-target

9 7 4
38,600 points

Related questions

0 votes
1 answer 20 views
20 views
Problem column name or number of supplied values does not match table definition
asked Feb 9 charles mathews 5.5k points
1 vote
1 answer 2 views
2 views
Problem: I am a student and learning Vhdl and facing this issue. Kindly help me. Vhdl code for 8 to 1 multiplexer using structural modelling.
asked Mar 25 PkGuy 13.1k points
0 votes
0 answers 6 views
6 views
Problem: opinion from expert needed in solving the question? two scoops of django best practices for django 1.8
asked Mar 7 bilal b 420 points
1 vote
1 answer 4 views
4 views
Problem : I would like to execute a stored procedure within a stored procedure, e.g. EXEC SP1 BEGIN EXEC SP2 END But I only want SP1 to finish after SP2 has finished running so I need to find a way for SP1 to wait for SP2 to finish before SP1 ends. SP2 is being executed as part of SP1 so I have something like: CREATE PROCEDURE SP1 AS BEGIN EXECUTE SP2 END
asked Mar 28 Shovo210 13.2k points
0 votes
1 answer 7 views
7 views
Problem: what columns are good index candidates? Specifically for an MS SQL database?
asked Mar 9 ummesalma 22k points
0 votes
1 answer 8 views
8 views
Problem: sql select top 1 from each group. how to solve this problem.
asked Mar 13 Dan phillip 4.1k points
1 vote
1 answer 12 views
12 views
Problem : I'm looking for any good ideas : What is the best practice use of SQL Server T-SQL error handling?
asked Mar 4 Shovo210 13.2k points
0 votes
1 answer 32 views
0 votes
1 answer 2 views
2 views
Problem: I am getting an error stating that the pop index of g in indexList is out of range: IndexError: pop index out of range
asked 2 days ago ummesalma 22k points
0 votes
1 answer 2 views
2 views
Problem: Index error list index out of range.
asked 3 days ago charles mathews 5.5k points