ssas.model_json_313_tables_partitions - V

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

RepoObject_guid: F45FD8EE-E90A-EC11-8516-A81E8446D5B0

Description

Examples

Entity Diagram

entity-ssas.model_json_313_tables_partitions

Columns

Table 1. Columns of ssas.model_json_313_tables_partitions - 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

nvarchar(500)

NULL

nvarchar(500)

NULL

nvarchar(max)

NULL

Foreign Key Diagram

entity_1_1_fk-ssas.model_json_313_tables_partitions

References

Referenced Objects

Object Reference Diagram - 1 1

entity_1_1_objectref-ssas.model_json_313_tables_partitions

Object Reference Diagram - Referenced - 30 0

entity_30_0_objectref-ssas.model_json_313_tables_partitions

Object Reference Diagram - Referencing - 0 30

entity_0_30_objectref-ssas.model_json_313_tables_partitions

Column Reference Diagram

entity_1_1_colref-ssas.model_json_313_tables_partitions

Indexes

PK_model_json_313_tables_partitions

idx_model_json_313_tables_partitions__2

idx_model_json_313_tables_partitions__3

Column Details

_

tables_partitions_annotations_ja

tables_partitions_annotations_ja

nvarchar(max)

NULL

tables_partitions_dataView

tables_partitions_dataView

nvarchar(500)

NULL

tables_partitions_mode

tables_partitions_mode

nvarchar(500)

NULL

tables_partitions_source_j

tables_partitions_source_j

nvarchar(max)

NULL

sql_modules_definition

ssas.model_json_313_tables_partitions - 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_partitions_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_partitions_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_partitions_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
Where
    j2.[Key] = 'dataView'
GO

Select
    DISTINCT
    j2.*
From
    ssas.model_json_31_tables                        As T1
    Cross Apply OpenJson ( T1.tables_partitions_ja ) As j1
    Cross Apply OpenJson ( j1.Value ) As j2
Where
    j2.[Key] = 'mode'
Go
*/
CREATE View ssas.model_json_313_tables_partitions
As
Select
    T1.databasename
  , T1.tables_name
  , T1.RepoObject_guid
  , j2.tables_partitions_name
  , j2.tables_partitions_annotations_ja
  , j2.tables_partitions_dataView
  , j2.tables_partitions_mode
  , j2.tables_partitions_source_j
From
    ssas.model_json_31_tables_T                      As T1
    Cross Apply OpenJson ( T1.tables_partitions_ja ) As j1
    Cross Apply
    OpenJson ( j1.Value )
    With
    (
        tables_partitions_name NVarchar ( 500 ) N'$.name'
      , tables_partitions_annotations_ja NVarchar ( Max ) N'$.annotations' As Json
      , tables_partitions_dataView NVarchar ( 500 ) N'$.dataView'
      , tables_partitions_mode NVarchar ( 500 ) N'$.mode'
      , tables_partitions_source_j NVarchar ( Max ) N'$.source' As Json
    ) As j2