| |
Welcome to the dBforums forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor here for ContentLink opt out.
|
 |
|

10-02-07, 18:33
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 6
|
|
|
referential integrity
|
Can anyone give me an example why not to enable referential integrity in a relationship?
Thannk you.
|
|

10-02-07, 19:11
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
um.....
as jerome howard once famously said, "i'm tryna think but nothin happens!"
|
|

10-02-07, 20:28
|
|
SQL Apprentice
|
|
Join Date: Jan 2007
Location: hiding
Posts: 8,144
|
|
|
Errrr.... You only have one table? 
__________________
George
You only stop learning when you stop asking questions.
|
|

10-02-07, 21:32
|
|
Resident Curmudgeon
|
|
Join Date: Feb 2004
Location: In front of the computer
Posts: 9,573
|
|
Quote:
|
Originally Posted by sakfree
Can anyone give me an example why not to enable referential integrity in a relationship?
|
You have already signed with another employer, and you bear GREAT ill-will toward your soon-to-be-former co-workers?
-PatP
|
|

10-04-07, 22:12
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 6
|
|
Quote:
|
Originally Posted by Pat Phelan
You have already signed with another employer, and you bear GREAT ill-will toward your soon-to-be-former co-workers?
-PatP
|
more details please, i don't understand your example
thanks
|
|

10-05-07, 05:48
|
|
COLOSSAL WIN
|
|
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 10,355
|
|
Relationships without integrity will never last and will leave you feeling a little dirty afterwards.
__________________
Gymnast 2.0
|
|

10-05-07, 06:05
|
|
Jaded Developer
|
|
Join Date: Nov 2004
Location: out on a limb
Posts: 5,460
|
|
Quote:
|
Originally Posted by pootle flump
Relationships without integrity will never last and will leave you feeling a little dirty afterwards.
|
but just as equally relationships without integrity can also have their uses, in the absence of the integrity they may be good enough (or even as good) if you take adequate precautions
__________________
Warning
May! contain traces of NUT. people with NUT allergies should not pay attention to any of the above
|
|

10-05-07, 07:15
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Sussex, England
Posts: 404
|
|
Laziness?
(You didn't say good example.)
|
|

10-05-07, 07:33
|
|
SQL Apprentice
|
|
Join Date: Jan 2007
Location: hiding
Posts: 8,144
|
|
Quote:
|
Originally Posted by sakfree
Quote:
|
Originally Posted by Pat Phelan
You have already signed with another employer, and you bear GREAT ill-will toward your soon-to-be-former co-workers?
-PatP
|
more details please, i don't understand your example
thanks
|
that's genius!
Sakfree; Pat is basically saying to do it out of spite
Quote:
|
Originally Posted by pootle flump
Relationships without integrity will never last and will leave you feeling a little dirty afterwards.
|
Cynic  :hug:
Quote:
|
Originally Posted by healdem
but just as equally relationships without integrity can also have their uses, in the absence of the integrity they may be good enough (or even as good) if you take adequate precautions
|
See corral 
__________________
George
You only stop learning when you stop asking questions.
|
|

10-05-07, 09:05
|
|
Resident Curmudgeon
|
|
Join Date: Feb 2004
Location: In front of the computer
Posts: 9,573
|
|
Quote:
|
Originally Posted by sakfree
more details please, i don't understand your example
|
Think of creating a database without using referential integrity as a kind of "time delayed industrial sabotage" where you know that things will come to a crashing halt, but you're betting that they won't crash before you leave and that no one will realize that you are the culprit.
-PatP
|
|

10-05-07, 09:49
|
|
SQLTeam Scrub
|
|
Join Date: Nov 2002
Location: Jersey
Posts: 9,127
|
|
Are you guys kidding...I've seen so many damn 3rd party products that have none.
What the do is that they use the applicaion to enforce integrity...which in my opinion is a mistake
It means the database design is not fully thought out
But it is prevelant out there
I need to get another job
|
|

10-06-07, 19:41
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 6
|
|
|
An example
|

10-06-07, 20:18
|
|
Registered User
|
|
Join Date: Jun 2007
Location: London
Posts: 955
|
|
I've been working with financial databases for over 20 years - I've only ever come across a couple that had any mention of primary or foreign keys. I can only assume that nobody here produces databases for banks. To be fair though I can't think of a reason why they didn't have RI built in.
I was going to list a whole bunch of different design approaches that make it difficult to use foreign keys but I won't as I can't be arsed with the flaming I'll get.
Mike
|
|

10-07-07, 11:22
|
|
Moderator.
|
|
Join Date: Sep 2002
Location: UK
Posts: 4,874
|
|
Quote:
|
Originally Posted by mike_bike_kite
I've been working with financial databases for over 20 years - I've only ever come across a couple that had any mention of primary or foreign keys. I can only assume that nobody here produces databases for banks. To be fair though I can't think of a reason why they didn't have RI built in.
|
Perhaps because they were built long ago when many DBMSs didn't actually support constraints, and nobody has decided to add them retrospectively? I can't imagine there is anything special about banking business that makes data integrity undesirable.
Quote:
|
Originally Posted by mike_bike_kite
I was going to list a whole bunch of different design approaches that make it difficult to use foreign keys but I won't as I can't be arsed with the flaming I'll get.
|
Go on, make our day 
Actually, foreign keys aren't always the ideal constraint - the lack of support for more complex types of constraint sometimes forces database designers into adding spurious columns just so that a foreign key can be contrived to do the job.
|
|

10-07-07, 11:27
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 13,556
|
|
Quote:
|
Originally Posted by andrewst
Go on, make our day 
|
geez, tony, didja hafta?
well, i'm outta this thread...
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|