Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    2

    Unanswered: SQL DB Diagram Help

    Hello,
    I am sort of new to databases and am looking for a little guidance as to how to set up a database for the following information. I want one master table of all computer names in my domain, which has compname, domain, mac, and IP.

    For each computer, I have gathered through a vbscript a list of all installed software and versions of that software. I want to make a table for each computer listing this info, but also dump each software title into a master software list so I have a whole rundown of what is on my domain.

    Where I fail to comprehend is how to link the tables via keys and relationships. Unfortunately, my management will not approve a simple software inventory application so I have to resort to this. Any help would be appreciated.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    If you have two tables with primary keys and non-key attributes then the final bit (setting up the foreign key) is easy peasy.
    ALTER TABLE (Transact-SQL) (although long winded, you want to concentrate on example "O")

  3. #3
    Join Date
    Apr 2010
    Posts
    2
    So I have a table for Computer names with PID (int), CompName, Domain. Each computer has many software titles, and each software title has one version on each computer, but many overall. I guess what I am asking is what the relationship between the CompName table and its corresponding InstalledSoftwareTitles table would be.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    It would be a many to many relationship.

    You implement this with what is commonly known as an association table. Its primary key is a composite of the primary keys of the Computer and Software.
    Lots of resources on the internets:
    association table database - Google Search

Tags for this Thread

Posting Permissions

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