Hi, as you know that each SSAS database Cube has Annotations objects that contains things like, comments, list of SQL table names for mapping and lots of other objects, best way to see them is to.
goto SSMS-> open SSAS serv -> Select a SSAS DB -> right click -> select Script database as-> creat to -> new Query editor window ->
The part that I need is the Table name and its ID
Table name is always in the ToolTip in the id is always in the value section a good example is like
Example 1 : look for tooltip="vwDate" And value="dbo_RptDate"
Example 2 : look for tooltip="vwSales" And value=" dbo_vwInnerSale "
<ddscontrolcontrolprogid="DdsShapes.DdsObjectManagedBridge.3"tooltip="vwDate"left="29994……………….snaptogrid="0">
<control>
<ddsxmlobjectstreaminitwrapperbinary="000800005410000088130000"/>
</control>
<layoutobject>
<ddsxmlobj>
<propertyname="LogicalObject"value="dbo_RptDate"vartype="8"/>
</ddsxmlobj>
</layoutobject>
<shapegroupshapeid="0"groupnode="0"/>
</ddscontrol>
<ddscontrolcontrolprogid="DdsShapes.DdsObjectManagedBridge.3"tooltip="vwSales"left="79525"……….snaptogrid="0">
<control>
<ddsxmlobjectstreaminitwrapperbinary="000800007e11000088130000"/>
</control>
<layoutobject>
<ddsxmlobj>
<propertyname="LogicalObject"value="dbo_vwInnerSale"vartype="8"/>
</ddsxmlobj>
</layoutobject>
<shapegroupshapeid="0"groupnode="0"/>
</ddscontrol>
This may take 5-10min, finally it will show you the XMLA file/format of the SSAS cube database.
What I am looking for is I want to Loop trough each Cube and then loop through read each Annotation and find the list of table names (tooltip) and its ID (value), my question is I know how to connect to SSAS to get the cubes but I don’t know how to work with the Annotation object, don’t know how to loop it if I need to and I don’t know how to get the table name and its tableID.
What I have is …….
#------------------------------------------------------------------------------------------
# CONNECT TO SSAS
#------------------------------------------------------------------------------------------
#Com: ----- Open SSAS and extract data -----
Import-Module SQLASCmdlets
#Create a server object of type AS
$SSASServer = New-Object Microsoft.AnalysisServices.Server
#$CubeAnnotation = New-Object Microsoft.AnalysisServices.Annotation
#$AnnotationCollection = New-Object Microsoft.AnalysisServices.Annotation
#Create a SSASserver instance variable
$SSASinstanceName = $ASServer
$SSASServer.connect($SSASinstanceName)
# Connect to only one CubeDatabase
$CubeDB = $SSASDB
#$CubeDatabase = $SSASServer.Databases.Item($CubeDBName)
# OR US CAN USE (Next Line)......
$CubeDatabase = $SSASServer.Databases.GetByName($CubeDB)
#############################################
#### Cubes
$Cubes = $CubeDatabase.Cubes | Sort-Object Name
#------------------------------------------------------------------------------------------
foreach ($Cube in $Cubes ) #| SELECT ID , Name , Annotations| Sort-Object Name)
{
Write-Output ''
Write-Output "------- Start Cubes"
Write-Output $Cube.Name
Write-Output "------- Start Annotations"
THIS PART I DON’T KNOW WHAT TO DO
THIS PART I DON’T KNOW WHAT TO DO
I need the
tooltip="vwDate" And value="dbo_RptDate"
tooltip="vwSales" And value=" dbo_vwInnerSale "
a loop some how
}