Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007

    Assigning extra information to all database table fields

    I'm an experienced desktop app programmer, but fairly new to database programming. I'm working with C#/SQL right now. I understand the concept of a lookup table, as in storing a two-character state (such as CA) in a field in one table, and then being able to get the full state name (such as California) from a second table:

    Table: Address
    AddressID int <PK>
    StateCode char(2) <FK>

    Table: State
    StateCode char(2) <PK>
    StateName varchar(25)

    My question: is there some similar way to be able to provide just about every field of every table with a means of holding common, extra information? For instance, let's say I wanted to store, say, an extended name and some special code with every field in three tables. As in this simplistic example:

    Table: A
    Field1 int
    Field2 varchar(20)

    Table: B
    Field1 bit
    Field2 int

    Table: C
    Field1 int

    Table: ExtraInfo
    LongName varchar(50)
    TypeCode int

    If I wanted to be able to have the information in the ExtraInfo table associated with each field in Table A, Table B and Table C, how would I do that?


  2. #2
    Join Date
    Jun 2003
    One piece of information in each field, please...that is Rule #1.
    If it's not practically useful, then it's practically useless.

    blindman "sqlblindman"

  3. #3
    Join Date
    Feb 2004
    One Flump in One Place
    Sticking with what you started with above and applying it to the question - do you mean store the StateCode in several tables? If so then yes and very easily. If not, are you thinking of a One True Lookup Table?
    pootle flump
    ur codings are working excelent.

Posting Permissions

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