ssas.model_json_361_perspectives_tables - V

type: V ( view ), modify_date: 2021-09-01 07:50:18

RepoObject_guid: 0360D8EE-E90A-EC11-8516-A81E8446D5B0

Description

Examples

Entity Diagram

entity-ssas.model_json_361_perspectives_tables

Columns

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

1

nvarchar(128)

NOT NULL

2

nvarchar(500)

NULL

3

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-ssas.model_json_361_perspectives_tables

References

Object Reference Diagram - 1 1

entity_1_1_objectref-ssas.model_json_361_perspectives_tables

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-ssas.model_json_361_perspectives_tables

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-ssas.model_json_361_perspectives_tables

Column Reference Diagram

entity_1_1_colref-ssas.model_json_361_perspectives_tables

Indexes

PK_model_json_361_perspectives_tables

idx_model_json_361_perspectives_tables__2

idx_model_json_361_perspectives_tables__3

Column Details

_

perspectives_tables_columns_ja

perspectives_tables_columns_ja

nvarchar(max)

NULL

perspectives_tables_hierarchies_ja

perspectives_tables_hierarchies_ja

nvarchar(max)

NULL

perspectives_tables_measures_ja

perspectives_tables_measures_ja

nvarchar(max)

NULL

sql_modules_definition

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

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

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

Select
    DISTINCT
    j2.*
From
    ssas.model_json_36_perspectives                    As T1
    Cross Apply OpenJson ( T1.perspectives_tables_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
Where
    j2.[Key] = 'columns'
GO
*/
CREATE View [ssas].[model_json_361_perspectives_tables]
As
Select
    T1.databasename
  , T1.perspectives_name
  , j2.perspectives_tables_name
  , j2.perspectives_tables_columns_ja
  , j2.perspectives_tables_hierarchies_ja
  , j2.perspectives_tables_measures_ja
From
    ssas.model_json_36_perspectives                    As T1
    Cross Apply OpenJson ( T1.perspectives_tables_ja ) As j1
    Cross Apply
    OpenJson ( j1.Value )
    With
    (
        perspectives_tables_name NVarchar ( 500 ) N'$.name'
      , perspectives_tables_columns_ja NVarchar ( Max ) N'$.columns' As Json
      , perspectives_tables_hierarchies_ja NVarchar ( Max ) N'$.hierarchies' As Json
      , perspectives_tables_measures_ja NVarchar ( Max ) N'$.measures' As Json
    ) As j2