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:
01547950
Views:
17
>>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.

How do you find the contraint? This table does not show this constraint in the Constraints branch.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform