Home Forums Database Design Relational Theory Is having a lookup table that is for multiple entities a common practice? RE: Is having a lookup table that is for multiple entities a common practice?

  • I worked in a place that had one of these monstrosities. It was named MasterXRef. By the time I arrived it was as you describe, somewhat wide and way too length for a lookup table. It was on the order of 40-50 columns and thousands and thousands of rows. This was a fairly large system so the table had to be expanded multiple times. The column for the "LookupGroup" was a varchar and identity used as the primary clustered index. It was truly awful. We had a lot of orphaned data in there for systems that no longer existed, we had invalid group values because there was no integrity. And worst of all it was getting slower and slower to do something that developers need to do repeatedly (fill comboboxes with lookup values). It wasn't horribly noticeable for 1 or 2 comboboxes but each query would be in the 3-4 second range. Now consider a webpage with 15 comboboxes being loaded by 10 people at the same time. Suddenly a query that wasn't so bad is crippled. Suffice it say I would agree with the others here that this is a horrible design.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/