• Register
1 vote
76 views

Problem :

I am facing bellow error
the create unique index statement terminated because a duplicate key was found for the object name
6.9k 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

38.6k points

Related questions

0 votes
1 answer 7 views
7 views
Problem: Create index on temp table sql server?
asked Jul 26 Mezbah 130k points
0 votes
1 answer 7 views
7 views
Problem: Sql server create index on temp table?
asked Jul 26 Mezbah 130k points
0 votes
1 answer 77 views
77 views
Problem: Can someone please guide me on how to resolve >A return statement with a return value cannot be used in this context.
asked May 9 ummeshani 10.8k points
0 votes
1 answer 97 views
97 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 18 views
18 views
Problem: I am currently learning Vhdl but unable to solve this issue: Vhdl code for 4 to 1 multiplexer using structural modelling.
asked Apr 26 PkGuy 25.9k points
1 vote
1 answer 20 views
20 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 25.9k points
0 votes
0 answers 18 views
18 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
0 votes
1 answer 45 views
45 views
Problem: How to convert julian date to normal date in sql?
asked Jul 9 Chi Omega 168k points
0 votes
1 answer 106 views
106 views
Problem : Is there any way to rectify this problem: The _______ join produces the cross product of two tables?
asked Jun 23 Siam55 110k points
0 votes
1 answer 8 views
8 views
Problem: I would be glad if I could get some tips on my code : Error string or binary data would be truncated.
asked May 27 Junia Phoebe 83.8k points