Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    2

    Dynamic Table Creation -- good idea or not?

    Hi,

    I'm creating an application that will allow each of it's users to create a list of their customers. Each user will have the ability to associate an aribtrary number of fields to their list of users. So user A might have a list of 20 customers, and wants to record their name, phone number and address. However user B may have completely different requirements and wants to list each customer by only their email address and hair colour (an odd combination -- but it should be possible).

    The problem is that if the application has a lot of users, one arbitrary "customer" table will not fit all their needs. One way around this would be to create a separate customer table for each user, i.e. user_A_customers would contain the fields name, phone_number and address_line_1 etc. whereas user_B_customers would have only 2 fields, email_address and hair_color.

    Is this an appropriate solution to the problem? Are there any drawbacks to this?

    Thanks,

    --SM

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    My opinion: customization is a poor substitute for requirements gathering.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Under normal circumstances, I would agree -- but unfortunately this customization is to be touted as a "feature".

    Putting the requirements issue aside, and accepting that the "customization" is required, is there a better way of providing this flexibility?

    --SM

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    I'd create a standard table structure for all required and common fields, and then add an XML datatype column to store custom attributes.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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