If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Dynamic Table Creation -- good idea or not?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-09, 11:52
SpiderMonkey SpiderMonkey is offline
Registered User
 
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
Reply With Quote
  #2 (permalink)  
Old 01-05-09, 12:00
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
  #3 (permalink)  
Old 01-05-09, 12:03
SpiderMonkey SpiderMonkey is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 01-05-09, 13:37
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On