473,651 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clarify "Enforce Relationship"

....please.

I've found other posts that explain the Cascade options, but the
Enforce relationships option still is foggy to me.

As to "enforcing relationship for ... UPDATEs"(with cascade NOT
checked), then I'm guessing that an update to that key field that would
normally cascade will instead produce some sort of constraint violation
error?

And if Cascade updates is checked, but I try to update a key in a table
on the many side of a relationship, then this won't cascade "up" to the
one side will it? Would it just produce a constraint violation?

With enforce relationship for insert:

Does this mean if I try to insert into the many side of a relationship
that I can't insert unless the keys that are related already exist in
the other table?

How does this apply to a one-to-one relationship? If I can't insert
into one table because the key isn't in the other one, how do I insert
the record with that key into both tables simultaniously? I'm sure I'm
wrong about some of my guesses here.

Thanks in advance.

Nov 13 '05 #1
1 2626
Shumaker,
Suppose Invoices and items on the invoice, or line items. With
relationships enforced you could not delete an invoice without first
deleting it's line items. If the primary key of invoices is something that
a user types like an invoice number, then you can't change the invoice
number in invoices without doing something about that same invoice number
listed in line items. Without cascade update enabled this normally means
that an invoice number can't be changed without disabling "enforce
relationships" temporarily, then changing the invoice number in related
records in line items first, then changing it in invoice, then re-enabling
"enforce relationships".

--
Alan Webb
kn*******@SPAMh otmail.com
"It's not IT, it's IS
<sh******@cs.fs u.edu> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
...please.

I've found other posts that explain the Cascade options, but the
Enforce relationships option still is foggy to me.

As to "enforcing relationship for ... UPDATEs"(with cascade NOT
checked), then I'm guessing that an update to that key field that would
normally cascade will instead produce some sort of constraint violation
error?

And if Cascade updates is checked, but I try to update a key in a table
on the many side of a relationship, then this won't cascade "up" to the
one side will it? Would it just produce a constraint violation?

With enforce relationship for insert:

Does this mean if I try to insert into the many side of a relationship
that I can't insert unless the keys that are related already exist in
the other table?

How does this apply to a one-to-one relationship? If I can't insert
into one table because the key isn't in the other one, how do I insert
the record with that key into both tables simultaniously? I'm sure I'm
wrong about some of my guesses here.

Thanks in advance.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2353
by: Sukkel | last post by:
When I define relations in the Backend of my Database, everything works fine. I get these funny lines (with 1 and "OO") between the fields of the different table that indicate a one to many relationship. Then, when I try to build a query in the frontend, these signs disappear in the query design window, and as a consequence, the form wizzard based on such a query won´t let me construct a subform in the main form. I could make my...
43
2819
by: Zeng | last post by:
It's so messy w/o the "friend" relationship. Does anyone know why it was not supported in C#. It's almost about as bad as it doesn't support the inheritance hierarchy and method reference (calling tree) browsing that is supported in C++. I don't know how some could write a large scale object-oriented application w/o those. If you have overcome these limitations in C#, please share your thoughts and ideas. Thanks!
2
1624
by: Mehdi | last post by:
Hi, I need to pass an URL via a hidden value as follow: <input type="hidden" id="Test" runat="Server"> and on Page_Load I assign a value to this hidden input as follow: Test.Value = "http://www.myserver.com?id=123&name=HomerSimpson";
0
8349
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.