configT.SsasDmvTableImport_DmvColumnList - V
type: V ( view ), modify_date: 2022-09-08 16:37:22
RepoObject_guid: D0E6A70A-8A06-EC11-8515-A81E8446D5B0
Description
obsolet
Because the target table structure was created from
Select * into Target from Soure
we just scan the target table columns to get the column lists
Columns
PK | Column Name | Data Type | NULL? | ID |
---|---|---|---|---|
|
|
|||
|
|
sql_modules_definition
configT.SsasDmvTableImport_DmvColumnList - V script
/*
<<property_start>>Description
obsolet
Because the target table structure was created from
`Select * into Target from Soure`
we just scan the target table columns to get the column lists
<<property_end>>
*/
CREATE View configT.SsasDmvTableImport_DmvColumnList
As
Select
T1.DmvTableName
, DmvColumnList = String_Agg ( Cast(QuoteName ( sc.name ) As NVarchar(Max)), Char ( 13 ) + Char ( 10 ) + ', ' ) Within Group(Order By
sc.column_id)
From
configT.SsasDmvTableImport As T1
Inner Join
sys.objects As so
On
so.name = T1.DmvTableName
And Schema_Name ( so.schema_id ) = 'ssas'
Inner Join
sys.columns As sc
On
sc.object_id = so.object_id
Where
T1.isActive = 1
--exclude the additional column, not existing in DMV view
And sc.name <> 'databasename'
--issues with [RefreshedTime] in $SYSTEM.[TMSCHEMA_COLUMNS]
--we simply not import it
--alternatively we should convert:
--CStr([RefreshedTime]) as [RefreshedTime]
--but then we need different column list for different usage
And sc.name <> 'RefreshedTime'
Group By
T1.DmvTableName