I'm using SQL Server 2012 to store the account settings for multiple accounts (each user account will have a set of settings). These settings could have any number of fields (has not been completely set and could grow) but each user account will have the same set of settings (different values of course).
Is it better (faster with a smaller footprint and more efficient) to:
-
give each setting its own column and each row to a user? keep in mind that there could be hundreds of settings variables. (i.e. userid, setting1, setting2, setting3…etc)
-
Relate each individual setting to a user and making it a name value pair table
(i.e. userid, settingsName, settingValue)
Best Answer
Already maintainability will ask for a structure like shown below.
An additional set of templates would support fast capture of new data (Structure like UserSettings with a templateid instead of userid)