How can I create a script that generates XMLA script from Analysis Services solution project
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.
Tags: faq, management, xmla