Skip to main content
Solved

An explicit DROP INDEX is not allowed on index 'dbo.table.unique_object'. It is being used for FOREIGN KEY constraint enforcement.

  • November 18, 2025
  • 4 replies
  • 15 views

SanderAdam
Captain
Forum|alt.badge.img+5

Hello everyone,

As the title suggests I have the that error on indexes:

I did see a post where a validation is supposed to be in place to prevent this from happening. But does that also count for when you create a unique constraint on multiple primary keys? Because I cannot find the validation and now I cannot (re)build my database anymore. I would need to fix this first, but in the newest validations by Thinkwise, a validation on this table would pop up urging it needs a unique constraint on the two primary keys used in the constraint. So what can I do to fix this? Did anybody else experience this problem?

 

Best answer by Mark Jongeling

Hi Sander, 

I haven't run into this situation myself, could you share the Table column and Index configurations? To resolve this, you can write an Upgrade script to manually remove this index for now.

If we know how to reproduce it, we can make sure this does not happen again in the future. Could you report this as a ticket in TCP for the Software Factory? Thanks!

4 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • Answer
  • November 24, 2025

Hi Sander, 

I haven't run into this situation myself, could you share the Table column and Index configurations? To resolve this, you can write an Upgrade script to manually remove this index for now.

If we know how to reproduce it, we can make sure this does not happen again in the future. Could you report this as a ticket in TCP for the Software Factory? Thanks!


SanderAdam
Captain
Forum|alt.badge.img+5
  • Author
  • Captain
  • November 24, 2025

Hi Sander, 

I haven't run into this situation myself, could you share the Table column and Index configurations? To resolve this, you can write an Upgrade script to manually remove this index for now.

If we know how to reproduce it, we can make sure this does not happen again in the future. Could you report this as a ticket in TCP for the Software Factory? Thanks!

Hi Mark,

We wrongly put a primary key pair in a unique index on the suggestion of a validation. But once we removed this index, the data model validation did not return. We found out the problem was the primary key in combination with a unique index and already managed to fix the issue.

The only concern is that this validation might pop up at wrong moments, because primary keys are already unique, so why would the SF validations (on the data model) suggest that a unique index on a (pair of) primary key(s) is desired?

I could make an issue in TCP, but I cannot reproduce the wrong validation anymore. So I think I can best mark your answer as the best answer as for now. Might it pop up again, then I will create a TCP issue. Thank you for your response!


Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • November 24, 2025

Which validation did you see? 

"Unique index is equal to the full primary key”’?

I don't see any validations that recommends you to add an index 😅


SanderAdam
Captain
Forum|alt.badge.img+5
  • Author
  • Captain
  • November 24, 2025

Which validation did you see? 

"Unique index is equal to the full primary key”’?

I don't see any validations that recommends you to add an index 😅

Then it might have been a misinterpretation, I shall ask my collegue about it.