Reputation: 19117
I have a user asking me to list the dimensions and dimension attributes of our SSAS cube.
I susspect I could generate this via AMO, but I'm wondering if there's an MDX query or SSMS option to show the same info.
Any ideas?
Upvotes: 2
Views: 9933
Reputation: 802
I had the same issue and I've created a .NET CLR for SQL server that returns a list of SSAS objects.
You can find it here: http://sasokoren.com/export-list-of-ssas-objects-and-translations-using-amo-in-net/
Upvotes: 1
Reputation: 8120
In SQL Server 2008, you can do the following:
Run the following query
select Dimension_Unique_Name, Property_Name, Property_Caption from $SYSTEM.MDSCHEMA_PROPERTIES where Cube_Name = [YOUR CUBE NAME HERE] And Property_Type = 1
(You can also do select * and get some other information like data_types, cardinality, etc.)
Upvotes: 2
Reputation: 19117
Here's a script via AMO
[Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") | Out-Null
$server = new-Object Microsoft.AnalysisServices.Server
$server.Connect($serverName)
foreach ($db in $server.Databases)
{
Write-Host $db.Name
foreach ($cb in $db.Cubes)
{
Write-Host "`t" + $cb.Name
foreach ($dm in $cb.Dimensions)
{
Write-Host "`t`t" + $dm.Name
foreach ($at in $dm.Attributes)
{
Write-Host "`t`t`t" + $at.Attribute
}
}
}
}
Upvotes: 3