ssas.model_json_31_tables - V

type: V ( view ), modify_date: 2021-09-20 15:15:59

RepoObject_guid: F15FD8EE-E90A-EC11-8516-A81E8446D5B0

Description

Examples

Entity Diagram

entity-ssas.model_json_31_tables

Columns

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

1

nvarchar(128)

NOT NULL

2

nvarchar(128)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

bit

NULL

nvarchar(max)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-ssas.model_json_31_tables

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-ssas.model_json_31_tables

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-ssas.model_json_31_tables

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-ssas.model_json_31_tables

Column Reference Diagram

entity_1_1_colref-ssas.model_json_31_tables

Indexes

PK_model_json_31_tables

idx_model_json_31_tables__2

Column Details

_

databasename

1

databasename

nvarchar(128)

NOT NULL

Referenced Columns

tables_name

2

tables_name

nvarchar(128)

NULL

tables_annotations_ja

tables_annotations_ja

nvarchar(max)

NULL

tables_columns_ja

tables_columns_ja

nvarchar(max)

NULL

tables_dataCategory

tables_dataCategory

nvarchar(500)

NULL

tables_description

tables_description

nvarchar(max)

NULL

tables_description_ja

tables_description_ja

nvarchar(max)

NULL

tables_hierarchies_ja

tables_hierarchies_ja

nvarchar(max)

NULL

tables_isHidden

tables_isHidden

bit

NULL

tables_measures_ja

tables_measures_ja

nvarchar(max)

NULL

tables_partitions_ja

tables_partitions_ja

nvarchar(max)

NULL

sql_modules_definition

ssas.model_json_31_tables - V script
/*
--check

Select
    Distinct
    j2.[Key]
  , j2.Type
From
    ssas.model_json_20                       As T1
    Cross Apply OpenJson ( T1.l2_tables_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
order by
    j2.[Key]
  , j2.Type

Go
*/

CREATE View ssas.model_json_31_tables
As
Select
    T1.databasename
  --, T1.l1_name
  --, T1.l1_compatibilityLevel
  --, T1.l1_id
  --, T1.l2_name
  --, T1.l2_annotations_ja
  --, T1.l2_culture
  --, T1.l2_cultures_ja
  --, T1.l2_dataSources_ja
  --, T1.l2_perspectives_ja
  --, T1.l2_relationships_ja
  --, T1.l2_roles_ja
  --, T1.l2_tables_ja
  , j2.tables_name
  , j2.tables_annotations_ja
  , j2.tables_columns_ja
  , j2.tables_dataCategory
  , j2.tables_description
  , j2.tables_description_ja
  , j2.tables_hierarchies_ja
  , j2.tables_isHidden
  , j2.tables_measures_ja
  , j2.tables_partitions_ja
From
    ssas.model_json_20                       As T1
    Cross Apply OpenJson ( T1.l2_tables_ja ) As j1
    Cross Apply
    OpenJson ( j1.Value )
    With
    (
        tables_name NVarchar ( 128 ) N'$.name'
      , tables_annotations_ja NVarchar ( Max ) N'$.annotations' As Json
      , tables_columns_ja NVarchar ( Max ) N'$.columns' As Json
      , tables_dataCategory NVarchar ( 500 ) N'$.dataCategory'
      , tables_description NVarchar ( Max ) N'$.description'
      , tables_description_ja NVarchar ( Max ) N'$.description' As Json
      , tables_hierarchies_ja NVarchar ( Max ) N'$.hierarchies' As Json
      , tables_isHidden Bit N'$.isHidden'
      , tables_measures_ja NVarchar ( Max ) N'$.measures' As Json
      , tables_partitions_ja NVarchar ( Max ) N'$.partitions' As Json
    ) As j2