ssas.model_json_314_tables_hierarchies - V

type: V ( view ), modify_date: 2021-09-01 08:43:49

RepoObject_guid: F65FD8EE-E90A-EC11-8516-A81E8446D5B0

Description

Examples

Entity Diagram

entity-ssas.model_json_314_tables_hierarchies

Columns

Table 1. Columns of ssas.model_json_314_tables_hierarchies - V
PK Column Name Data Type NULL? ID

1

nvarchar(128)

NOT NULL

2

nvarchar(128)

NOT NULL

3

nvarchar(500)

NULL

uniqueidentifier

NOT NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-ssas.model_json_314_tables_hierarchies

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-ssas.model_json_314_tables_hierarchies

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-ssas.model_json_314_tables_hierarchies

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-ssas.model_json_314_tables_hierarchies

Column Reference Diagram

entity_1_1_colref-ssas.model_json_314_tables_hierarchies

Indexes

PK_model_json_314_tables_hierarchies

idx_model_json_314_tables_hierarchies__2

idx_model_json_314_tables_hierarchies__3

Column Details

_

databasename

1

databasename

nvarchar(128)

NOT NULL

tables_name

2

tables_name

nvarchar(128)

NOT NULL

tables_hierarchies_name

3

tables_hierarchies_name

nvarchar(500)

NULL

RepoObject_guid

RepoObject_guid

uniqueidentifier

NOT NULL

tables_hierarchies_levels_ja

tables_hierarchies_levels_ja

nvarchar(max)

NULL

sql_modules_definition

ssas.model_json_314_tables_hierarchies - V script
/*
--get and check existing values

Select
    Distinct
    j2.[Key]
  , j2.Type
From
    ssas.model_json_31_tables                         As T1
    Cross Apply OpenJson ( T1.tables_hierarchies_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
ORDER BY
    j2.[Key]
  , j2.Type
Go

Select
    T1.*
  , j2.*
From
    ssas.model_json_31_tables                         As T1
    Cross Apply OpenJson ( T1.tables_hierarchies_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
Go

Select
    DISTINCT
    j2.*
From
    ssas.model_json_31_tables                         As T1
    Cross Apply OpenJson ( T1.tables_hierarchies_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
Where
    j2.[Key] = 'levels'
GO
*/
CREATE View ssas.model_json_314_tables_hierarchies
As
Select
    T1.databasename
  , T1.tables_name
  , T1.RepoObject_guid
  , j2.tables_hierarchies_name
  , j2.tables_hierarchies_levels_ja
From
    ssas.model_json_31_tables_T                       As T1
    Cross Apply OpenJson ( T1.tables_hierarchies_ja ) As j1
    Cross Apply
    OpenJson ( j1.Value )
    With
    (
        tables_hierarchies_name NVarchar ( 500 ) N'$.name'
      , tables_hierarchies_levels_ja NVarchar ( Max ) N'$.levels' As Json
    ) As j2