+ Reply to Thread
Results 1 to 3 of 3

Thread: a table with 2 relationships with the same table

  1. #1
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    a table with 2 relationships with the same table

    I have a table that has names of people in it.

    The info in that table can form a relationship with another table in two different ways. how can i do that?

    an example would be:

    tblNames.FieldName to tblAsset.FieldOwner

    tblNames.FieldName to tblAsset.FieldBorrower

    FieldName means the the field Name (yes i know that is a reserve word. this is just conceptual)

    If I want the same names to be borowers as owners (depending on the circumstances) then I would need to use the same table or at least copy from one to another when a new name is added or deleted.

  2. #2
    Moderator don94403 is a jewel in the rough don94403 is a jewel in the rough don94403 is a jewel in the rough don94403's Avatar
    Join Date
    Mar 2008
    Location
    San Mateo, CA, USA
    Posts
    313
    Blog Entries
    8
    Real Name
    Don Ravey
    Rep Power
    6

    You must think of this in terms of Primary Keys and Foreign Keys. If your tblNames has a Primary Key field such as NameID, then your tblAssets could have 2 Foreign Key fields that can relate to tblNames, one could be OwnerID and the other BorrowerID.
    question = 2B || !2B

  3. #3
    Barn Regular nboscaino is an unknown quantity at this point nboscaino's Avatar
    Join Date
    Jul 2008
    Location
    Philadelphia, PA
    Posts
    97
    Rep Power
    4

    Thanks so much. As it turns out I was just thinking too much. I implimented the concept on a much smaller database to isolate it and it was very simple. WIth alot of other things going in the database I want to use it in it seemed complex. I was just over thinking.



    Thanks

+ Reply to Thread

Similar Threads

  1. Table Error
    By micky in forum Microsoft SQL Server
    Replies: 14
    Last Post: July 17th, 2009, 04:03 AM
  2. SQL Server CREATE TABLE..LIKE
    By Wolffy in forum SQL Code Samples
    Replies: 2
    Last Post: March 12th, 2009, 05:51 PM
  3. Table or Query
    By gjh in forum Microsoft Access
    Replies: 2
    Last Post: March 5th, 2009, 05:09 PM
  4. Table troubles
    By bryceowen in forum HTML & CSS Help
    Replies: 7
    Last Post: February 6th, 2009, 12:02 PM
  5. Table border help
    By Rebelle in forum HTML & CSS Help
    Replies: 3
    Last Post: December 5th, 2008, 12:43 PM

Bookmarks

Posting Permissions

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

SEO by vBSEO