Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropping index for foreign key constraint
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01547941
Message ID:
01547948
Vues:
26
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform