Search code examples
sql-serverdatabasessasdatabase-schema

Best practices for analyzing/reporting database with 'flexible' schema


I am given a task to create views (Excel, websites, etc. not database 'view') for a SQL Server table with 'flexible' schema like below:

Session(guid) | Key(int) | Value(string)

My first thought is to create a series of 'standard' relational data tables/views that speak to the analysis/reporting requests. They can be either new tables updated by a daemon service who transforms data on a schedule, or just a series of views with deeply nested queries. Then, use SSAS, SSRS and other established ways to do the analysis and reporting. But I'm totally uncertain if that's the right line of thinking.

So my questions are:

  1. Is there a terminology for this kind of 'flexible' schema so that I can search for related information?
  2. Do my thoughts make sense or they're totally off?
  3. If my thoughts make sense, should I create views with deep queries or new tables + data transform service?

Solution

  • Finally found the terminology - it's called entity-attribute-value pattern (EAV) and there are a lot of discussions and resources around it.