Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    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.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    um.....

    as jerome howard once famously said, "i'm tryna think but nothin happens!"
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Errrr.... You only have one table?
    George
    Home | Blog

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    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

  5. #5
    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

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Relationships without integrity will never last and will leave you feeling a little dirty afterwards.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    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
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404
    Laziness?

    (You didn't say good example.)

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    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
    Home | Blog

  10. #10
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    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

  11. #11
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  12. #12
    Join Date
    Sep 2007
    Posts
    6

    An example

    http://office.microsoft.com/en-us/te...aspx?av=ZAC000

    These are templates for access 2003, see the "Classroom management database" relationships

    The relationship "Classes" and "Instructors"

  13. #13
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    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

  14. #14
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    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.

  15. #15
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by andrewst
    Go on, make our day
    geez, tony, didja hafta?

    well, i'm outta this thread...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •