Results 1 to 3 of 3

Thread: Part 5: Card, Vendor, Purchase

  1. #1
    Join Date
    Dec 2006
    Location
    Portland, Oregon
    Posts
    64

    Question Part 5: Card, Vendor, Purchase

    (This thread is associated with part 5 of the SqlCredit series published Friday, May 25th.)

    Please comment on any aspect of the latest entry in the SqlCredit series: the article, the latest changes to the database code, whatever.
    Last edited by rgarrison; 05-25-2007 at 09:21 AM. Reason: Updated after publish

  2. #2
    Join Date
    Jun 2007
    Posts
    1

    Relational integrity for PrimaryCardHolderID

    The way it is now (in part 5), I think there are some problems regarding the integrity of data stored in the PrimaryCardHolderID column. I see that you have not created the Account_PrimaryCardholder_FK foreign key, probably to allow entering a 0 for the PrimaryCardHolderID in the _AccountCreate procedure. A better design would be to allow nulls in this column and keep the foreign key. Why? Because now you can delete a card holder (with the CardholderDelete procedure) while it is the primary card holder for an account (as long as there is no card for that holder).

    Razvan

  3. #3
    Join Date
    Dec 2006
    Location
    Portland, Oregon
    Posts
    64
    My plan is to move this to an associative table mapping a Cardholder to an Account. This will get around all the ugliness that resulted from this weird two-way relationship between Cardholder and Account.

Posting Permissions

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