SSAS-Info.com - Microsoft SQL Server Analysis Services (SSAS) 2005/2008 resource hub
SSAS FAQ Management FAQ How can I create a script that generates XMLA script from Analysis Services solution project
How can I create a script that generates XMLA script from Analysis Services solution project
User Rating: / 2
PoorBest 
Written by Vidas Matelis   
Saturday, 28 April 2007 18:57

Q: How can I create a script that generates XMLA script from Microsoft SQL Server Analysis Services 2005 solution project ?

A: To create an XMLA script from SSAS solution project you have to buld solution (generate .asdatabase file), then run deployment wizard with option specifying that you want to generate XMLA script. Step by step guide:

  • Run script to build solution:
    devenv.exe YourSolution.sln /build development /out BuildOutputLog.log
    Instead of /build you can specify /rebuild
    Instead of development you can specify other soluction configuration, like: Release
    Example:

 "c:\Program Files\Microsoft Visual Studio 8\Common7\ide\devenv.exe" "c:\documents and settings\vidas\my documents\visual studio 2005\projects\MySolution\MySolution.sln" /build development /out BuildOutputLog.log

  • Optionally run deployment wizard in answer mode to generate deployment script configuration. This is interactive step and can be done just once. Command:
    Microsoft.AnalysisServices.Deployment.exe MySolution.asdatabase /a
    Here /a runs deployment wizard in answer mode.
    Example:

Microsoft.AnalysisServices.Deployment.exe "c:\documents and settings\Vidas\My Documents\Visual Studio 2005\Projects\MySolution\MySolution\bin \MySolution.asdatabase" /a

  • Run deployment wizard command line script to generate XMLA file:
    Microsoft.AnalysisServices.Deployment.exe MySolution.asDatabase /d /o:c:\MySolutionXMLAScript.xmla
    Example:

Microsoft.analysisServices.Deployment.exe "c:\Documents And Settings\Vidas\My Documents\Visual Studio 2005\Projects\MySolution\MySolution\bin \MySolution.asDatabase" /d /o:c:\MySolutionXMLAScript.xmla

You could use ascmd utility and generated XMLA file to deploy analysis services database. 

Note: File Microsoft.AnalysisServices.Deployment.exe by default is located in the folder C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE and it is included in the path, so you do not have to specify full path in the script.
I used MySolution name for Solution and Project.

 

 
Comments (4)
4 Friday, 08 August 2008 18:06
Kevin
Is there a way to programmatically script an xmla file from a OLAP db on an Analysis Server? I know the way to create a .abf backup file, but I do not know how to programmatically create a xmla file.
3 Monday, 05 May 2008 18:51
ROd1
i guess for security reasons the pwd is not being included in the script as plain text, the same occurs for connection strings (the password is never printed out as part of the connection string, eventhough the system knows it) - you need to tell the system the password to use.
2 Friday, 11 April 2008 01:48
admin
Ramesh, I do not know answer to this question. I allways use just trusted connection settings. Sorry..
1 Thursday, 10 April 2008 15:21
Ramesh Revelli
Hi Vidas,

I used these utilities for automating my deployment. We are using Oracle as DS and when deploying the Password is not getting stored in the DS of the deployed cube. I changed the value from
PasswordRemoved to Unchanged in Cube.configsettings file. Still it is not retaining the password. Is there any way to retain the password.