lookup table & main table relationship

  • Hi there,

    I am working on creating data model from existing database.

    Present DB is w/o PK-FKs & I am working to create relational DB which enforces RI etc

    I have a lookup table which contains language codes,used by main table. The problem ,I am running into, is that these language codes(from lookup table) are used by 3 columns.

    So, I am wondering how can I enforce PK-FK relationship here.

    As in...

    language_code from lookup table is PK and it has to associated w/ column(s) existing in main table

    Thanks

  • If I understand the question, you simply add the relationship three different times, relating the lookup value to the three different columns individually. It's a fine method.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I am using Visio 2007 Professional and it seems VISIO doesn't allow relating a single column (from parent table) to 3 different columns. It associates with Either ColA or ColB or ColC.. not with all of them 🙁

  • Ah, that's a shortcoming with the tool, not SQL Server. Ummm, you might try associating to the first column and then renaming the association (not sure how to do that) and then try adding to the next column.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thanks for quick response.

    yes, its Visio related issue. 😐

    thanks

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply