Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foreigh Key Constraint problem
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Foreigh Key Constraint problem
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01537095
Message ID:
01537095
Views:
63
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?
"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
Next
Reply
Map
View

Click here to load this message in the networking platform