Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foreigh Key Constraint problem
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01537095
Message ID:
01537096
Vues:
24
>Hi,
>
>I am running again into the problem with setting up a Foreign Key constraint (very frustrating). Here is the example:
>
>Table 1. VENDORS
> This table has unique field VENDOR_ID
>
>Table 2. PRODUCTS
> This table has field VENDOR_ID. I want to set up constraint as following:
>
>
>ALTER TABLE [dbo].[products]  WITH CHECK ADD  CONSTRAINT [FK_products_vendor] FOREIGN KEY([vendor_id])
>REFERENCES [dbo].[vendors] ([vendor_id])
>ON UPDATE CASCADE
>
>
>I get message:
>
>
>Introducing FOREIGN KEY <name> may cause cycles or multiple cascade paths. Specify ON UPDATE NO ACTION
>
>
>But if I specify ON UPDATE NO ACTION what good is this constraint? I don't see a problem of the multiple cascade paths here. What am I missing? How do you get around this issue with SQL Server?

Does vendor or products table already have another constraint with CASCADE enabled?
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