dbTalk Databases Forums  

Removing foreign key constraints

comp.databases comp.databases


Discuss Removing foreign key constraints in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bob
 
Posts: n/a

Default Removing foreign key constraints - 07-07-2004 , 01:14 PM






Hi there,

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?

Bob

Reply With Quote
  #2  
Old   
Nick Landsberg
 
Posts: n/a

Default Re: Removing foreign key constraints - 07-07-2004 , 02:05 PM






Bob wrote:

Quote:
Hi there,

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?

Bob
Go lie down until the feeling goes away! ::grin::

If your customer's administrator has interactive SQL
access to the database (which they legitimately
have a right to do as administrators) they will also
be able to inadvertantly screw up the integrity
unless you enforce it with the database.

The probability that this will happen approaches 1.

NPL

--
"It is impossible to make anything foolproof
because fools are so ingenious"
- A. Bloch


Reply With Quote
  #3  
Old   
Alan
 
Posts: n/a

Default Re: Removing foreign key constraints - 07-07-2004 , 02:21 PM




"Bob" <boblotz2001 (AT) yahoo (DOT) com> wrote

Quote:
Hi there,

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?

Bob
The answer depends on the answers to these questions:

1. Whose butt is on the line if the data gets screwed up?
2. Do you subscribe to the theory that the liklihood of an event is
inversely proportional to the desireability of its happening?
3. Is it your boss' idea to do away with FK constraints?
4. Will doing away with FK constraints solve a problem?




Reply With Quote
  #4  
Old   
Tom Hester
 
Posts: n/a

Default Re: Removing foreign key constraints - 07-07-2004 , 05:58 PM



Nick Landsberg wrote:
Quote:
Bob wrote:

Hi there,

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?

Bob


Go lie down until the feeling goes away! ::grin::

If your customer's administrator has interactive SQL
access to the database (which they legitimately
have a right to do as administrators) they will also
be able to inadvertantly screw up the integrity
unless you enforce it with the database.

The probability that this will happen approaches 1.

NPL

If anything, Nick is an optimist. Don't do it.


Reply With Quote
  #5  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Removing foreign key constraints - 07-07-2004 , 07:10 PM



Nick Landsberg <SPAMhukolauTRAP (AT) SPAMworldnetTRAP (DOT) att.net> wrote:

Quote:
Bob wrote:

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?
Application-level validation means how many program have to be
updated when the rules change, means how many chances to get it wrong?

Quote:
Go lie down until the feeling goes away! ::grin::

If your customer's administrator has interactive SQL
access to the database (which they legitimately
have a right to do as administrators) they will also
be able to inadvertantly screw up the integrity
unless you enforce it with the database.

The probability that this will happen approaches 1.
And if it were possible to approach from the high side, that
would happen.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #6  
Old   
Tony
 
Posts: n/a

Default Re: Removing foreign key constraints - 07-08-2004 , 07:39 AM



boblotz2001 (AT) yahoo (DOT) com (Bob) wrote in message news:<77f25a90.0407071014.74d9d3e7 (AT) posting (DOT) google.com>...
Quote:
Hi there,

Wanted to get a feel for what the feeling was out there about removing
foreign key constraints on the database side for the n-tier
application that enforces the integrity in the middle tier.
Theoretically, if the only way the database is updated is through the
application there might not be a need to enforce foreign key
constraints. Any thoughts?

Bob
The other posters have said it all, but you may find this discussion
of the same topic (in an Oracle-specific context, but applicable
anywhere) interesting:

http://asktom.oracle.com/pls/ask/f?p...:6091237036109


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.