ssas.model_json_20 - V

type: V ( view ), modify_date: 2021-09-01 09:26:41

RepoObject_guid: F05FD8EE-E90A-EC11-8516-A81E8446D5B0

Description

Examples

Entity Diagram

entity-ssas.model_json_20

Columns

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

nvarchar(128)

NOT NULL

int

NULL

nvarchar(500)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-ssas.model_json_20

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-ssas.model_json_20

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-ssas.model_json_20

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-ssas.model_json_20

Column Reference Diagram

entity_1_1_colref-ssas.model_json_20

Indexes

idx_model_json_20__1

Column Details

_

l1_compatibilityLevel

l1_compatibilityLevel

int

NULL

l1_id

l1_id

nvarchar(500)

NULL

Referenced Columns

l1_name

l1_name

nvarchar(500)

NULL

Referenced Columns

l2_annotations_ja

l2_annotations_ja

nvarchar(max)

NULL

l2_culture

l2_culture

nvarchar(500)

NULL

l2_cultures_ja

l2_cultures_ja

nvarchar(max)

NULL

l2_dataSources_ja

l2_dataSources_ja

nvarchar(max)

NULL

l2_description

l2_description

nvarchar(max)

NULL

l2_description_ja

l2_description_ja

nvarchar(max)

NULL

l2_name

l2_name

nvarchar(500)

NULL

l2_perspectives_ja

l2_perspectives_ja

nvarchar(max)

NULL

l2_relationships_ja

l2_relationships_ja

nvarchar(max)

NULL

l2_roles_ja

l2_roles_ja

nvarchar(max)

NULL

l2_tables_ja

l2_tables_ja

nvarchar(max)

NULL

sql_modules_definition

ssas.model_json_20 - V script
/*
Select
    Distinct
    j2.[Key]
  , j2.Type
From
    ssas.model_json_10 As T1
    Cross Apply OpenJson ( T1.l1_model_j )
                --As j1
                --Cross Apply OpenJson ( j1.Value )
                       As j2
order by j2.[Key]
Go

Select
    T1.*
  , j2.*
From
    ssas.model_json_10 As T1
    Cross Apply OpenJson ( T1.l1_model_j )
                --As j1
                --Cross Apply OpenJson ( j1.Value )
                       As j2
Go

*/

CREATE View ssas.model_json_20
As
Select
    --T1.*
    --, j2.*
    T1.databasename
  , T1.l1_name
  , T1.l1_compatibilityLevel
  , T1.l1_id
  --, T1.l1_model_j
  , j2.l2_name
  , j2.l2_annotations_ja
  , j2.l2_culture
  , j2.l2_cultures_ja
  , j2.l2_dataSources_ja
  , j2.l2_description
  , j2.l2_description_ja
  , j2.l2_perspectives_ja
  , j2.l2_relationships_ja
  , j2.l2_roles_ja
  , j2.l2_tables_ja
From
    ssas.model_json_10 As T1
    Cross Apply
    OpenJson ( T1.l1_model_j )
    --As j1
    --Cross Apply
    --OpenJson ( j1.Value )
    With
    (
        l2_name NVarchar ( 500 ) N'$.name'
      , l2_annotations_ja NVarchar ( Max ) N'$.annotations' As Json
      , l2_culture NVarchar ( 500 ) N'$.culture'
      , l2_cultures_ja NVarchar ( Max ) N'$.cultures' As Json
      , l2_dataSources_ja NVarchar ( Max ) N'$.dataSources' As Json
      , l2_description NVarchar ( Max ) N'$.description'
      , l2_description_ja NVarchar ( Max ) N'$.description' As Json
      , l2_perspectives_ja NVarchar ( Max ) N'$.perspectives' As Json
      , l2_relationships_ja NVarchar ( Max ) N'$.relationships' As Json
      , l2_roles_ja NVarchar ( Max ) N'$.roles' As Json
      , l2_tables_ja NVarchar ( Max ) N'$.tables' As Json
    --, l2_calculationGroups_ja NVarchar ( Max ) N'$.calculationGroups' As Json --?, not used in my models
    )                  As j2