Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dropping index for foreign key constraint
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01547941
Message ID:
01547948
Views:
25
>Hi,
>
>What is the syntax for dropping an index possibly used in a foreign key constraint? I have a table that has a unique index key. When I try to remove it using the following syntax:
>
>
>use [MyDatabase]
>drop index [IX_field_name] on TableName
>
>
>I get message that
>
>An explicit DROP INDEX is not allowed on index 'TableName.IX_field_name'. It is being used for FOREIGN KEY 
>constraint enforcement.
>
>
>I have removed all FK constraint on this field in other/child tables. So it must be something in this TableName. If not, how do I find out what foreign key is using this index key?
>
>TIA.

Find the constraint name and use DROP CONSTRAINT command.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform