DB Design for Dynamic DB Structure Change

  • Hi ALL,

    i dont know exactly what this concept called, i will explain the requirement

    i have aspx page where i am giving the application users details like

    TableName: UserInfo

    Column1: UserName

    Column2: Password(encrypted)

    Column3: MailID

    Column4: ContactInfo

    i should allow the application administrator to add any additional info, if he want to add PHONE then in UI/ASPX i am able to add this fields ,

    But what i want is , how should i handle this kind of dynamically added info at DB Level

    1. Should i add the PHONE column to "UserInfo" table

    2. Should i create a table to store all this kind of columns , and another table to store this kind of newly added columns data

    tomorrow admin may want to add FAX ???

    i know that this is a big concept , at least any one provide me how can we achieve this

    Thanks in advance

  • This is ,as you say, a big concept, and one that is impossible to summarise effectively.

    IMO, you are looking at the problem the wrong way.

    It's not a question of how to store the data that needs answering.

    But more, what do i need to do with the data once its stored ? When you've answered that you may have a hope of answering the first.

    For instance, using the phone number example, if you add it as a column then you are limited to one per user. But if you use a child table then you can have multiple , Home / Work etc.

    The BIG difference will be when you want to run a query using phone numbers.

    If you use columns in your main table then you have to do two queries, using a child table then one.

    Rarely are there issue with inserting data into a database , but big issues getting it out again.

    in 2) i think you may be suggesting a "ruling domain table". This is a terrible idea. Dont even go there.

    Heres a link you may find helpful http://www.simple-talk.com/sql/database-administration/ten-common-database-design-mistakes/



    Clear Sky SQL
    My Blog[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

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