sql server 2008 - Vertical or horizontal t-sql table for multiple settings? -


Assume that you need a table to store the settings. For example, I want to store the vehicle settings in a table, but there are more than 100 settings, so it is better to place a table with 100 columns or a table, maybe 2 columns (1 for the setting name and Value of setting for 1)

Either it has the advantage and disadvantages.

For flexibility, I must go to the workspace (each setting in each row)

If you are using one setting per line,

  • It will be easy to add new settings or delete unwanted settings in the future without changing the table schema.
  • You may have a user interface to do this without touching the database.
  • Your customer is set to request without your attention You can add / remove

    but

    <

  • / P>
    • Intellisense
    • This is just a record, must be fast
    • No looping No, no cursor

      But you may have to fill in all the columns if they are not drains

    • Change the schema, all of you depend Code may need to be changed

Comments