Skip to main content

Saving Storing multiple settings for multiple accountsusers in a SQL Server table

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:

  1. 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 setting1, setting2, setting3...etc)

  2. Relate each individual setting to a user and making it a name value pair table   
    (i.e. userid,settingsName settingsName, settingValue)

Saving settings for multiple accounts in SQL Server

I'm using SQL 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:

  1. 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)

  2. Relate each individual setting to a user and making it a name value pair table  (i.e. userid,settingsName, settingValue)

Storing multiple settings for multiple users in a SQL Server table

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:

  1. 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)

  2. Relate each individual setting to a user and making it a name value pair table 
    (i.e. userid, settingsName, settingValue)

Tweeted twitter.com/#!/StackDBAs/status/310609623164002304
edited tags; edited title
Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663

Which Method is better for saving Settings Saving settings for multiple accounts in SQL Server

Source Link

Which Method is better for saving Settings for multiple accounts in SQL

I'm using SQL 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:

  1. 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)

  2. Relate each individual setting to a user and making it a name value pair table (i.e. userid,settingsName, settingValue)