ssas.model_json_331_dataSources_annotations - V
type: V ( view ), modify_date: 2021-09-01 06:41:44
RepoObject_guid: FB5FD8EE-E90A-EC11-8516-A81E8446D5B0
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
1 |
|
|
||
2 |
|
|
||
3 |
|
|
||
|
|
|||
|
|
Indexes
PK_model_json_331_dataSources_annotations
-
IndexSemanticGroup: no_group
-
databasename; nvarchar(128)
-
[column-dataSources_name]; nvarchar(500)
-
[column-dataSources_annotations_name]; nvarchar(500)
-
-
PK, Unique, Real: 1, 1, 0
idx_model_json_331_dataSources_annotations__2
-
IndexSemanticGroup: databasename,dataSources_name
-
databasename; nvarchar(128)
-
[column-dataSources_name]; nvarchar(500)
-
-
PK, Unique, Real: 0, 0, 0
idx_model_json_331_dataSources_annotations__3
-
IndexSemanticGroup: no_group
-
databasename; nvarchar(128)
-
-
PK, Unique, Real: 0, 0, 0
Column Details
sql_modules_definition
ssas.model_json_331_dataSources_annotations - V script
/*
--get and check existing values
Select
Distinct
j2.[Key]
, j2.Type
From
ssas.model_json_33_dataSources As T1
Cross Apply OpenJson ( T1.dataSources_annotations_ja ) As j1
Cross Apply OpenJson ( j1.Value ) As j2
order by
j2.[Key]
, j2.Type
Go
Select
T1.*
, j2.*
From
ssas.model_json_33_dataSources As T1
Cross Apply OpenJson ( T1.dataSources_annotations_ja ) As j1
Cross Apply OpenJson ( j1.Value ) As j2
Go
Select
DISTINCT
j2.*
From
ssas.model_json_33_dataSources As T1
Cross Apply OpenJson ( T1.dataSources_annotations_ja ) As j1
Cross Apply OpenJson ( j1.Value ) As j2
Where
j2.[Key] = 'value'
GO
*/
CREATE View ssas.model_json_331_dataSources_annotations
As
Select
T1.databasename
, T1.dataSources_name
, j2.dataSources_annotations_name
, j2.dataSources_annotations_value
, j2.dataSources_annotations_value_ja
From
ssas.model_json_33_dataSources As T1
Cross Apply OpenJson ( T1.dataSources_annotations_ja ) As j1
Cross Apply
OpenJson ( j1.Value )
With
(
dataSources_annotations_name NVarchar ( 500 ) N'$.name'
, dataSources_annotations_value NVarchar ( Max ) N'$.value'
, dataSources_annotations_value_ja NVarchar ( Max ) N'$.value' As Json --currently no array in my data
) As j2