I have three tables imported from Access that had relationships with
eachother and had Cascading Deletes set to TRUE. The tables related in a
simple manner.
tblPackingList.PackingListID to tblPackingListPart.PackingListID
tblPackingListPart.PackingListPartID to
tblPackingListPart.PackingListPartSerialID.
For some reason, I cannot establish the relationship between
tblPackingList.PackingListID and tblPackingListPart.PackingListID. I get the
following error.
tblPackingListPart' table
- Unable to create relationship 'FK_tblPackingListPart_tblPackingList'.
Introducing FOREIGN KEY constraint 'FK_tblPackingListPart_tblPackingList' on
table 'tblPackingListPart' may cause cycles or multiple cascade paths.
Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN
KEY constraints.
Could not create constraint. See previous errors.
What I did was delete the relationships from each table. The primary key for
each table is set to be Unique. The following keys are primary.
tblPackingList.PackingListID
tblPackingListPart.PackingListPartID
tblPackingListPartSerial.PackingListPartSerialID
I need the relationship between tblPackingList and tblPackingListPart to
Cascade Delete in the event the master record in tblPackingList is deleted,
but no matter what I do I cannot get he relationship to save. I keep getting
the above error no matter what I do. What must I do to resolve what appears
to me to be a bug. Or, am I missing something.
Thanks.
P.S. My apologies if this is posted under the wrong section, but I have no
idea what would be the appropriate area to post a question such as this.
Thanks.
Hello,
To understand the issue better, will you try to create three new tables
with similar schema to see if you could reproduce the issue. If so, will
you provide the exact script so that I may reproduce the issue on my side.
I tried the following script but I was not able to reproduce the problem.
=====
create table tblPackingList (PackingListID int primary key, packinglistname
varchar(20))
create table tblPackingListPart (PackingListPartID int primary key,
PackingListID int)
create table tblPackingListPartSerial (PackingListPartSerialID int primary
key, PackingListPartID int)
alter table tblpackingListPart add constraint fk_1 Foreign key
(PackingListID) references tblPackingList(PackingListID) on delete cascade
alter table tblpackingListPartSerial add constraint fk_2 Foreign key
(PackingListPartID) references tblPackingListPart(PackingListPartID) on
delete cascade
=====
Also, you may want to refer to the following article for more details:
321843Error message 1785 occurs when you create a FOREIGN KEY constraint
that may cause multiple cascade paths
http://support.microsoft.com/default.aspx?scid=kb;EN-US;321843
Please let's know if you have other related information. I'm looking
forward to your reply. Thank you!
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment