There was a question recently on the Analysis Services newsgroup asking how to process an Analysis Services 2005 cube using XMLA from the command line. Below is a script based on Chris Harrington’s excellent Thin Olap blog. This is the absolute minimum script required to get an Analysis Services database to process (ie. No error handling ).
Processing an AS2005 cube from the command line with XMLA
*****************************************************
On my machine I processed my “Sandpit“ database (the sandpit is where I play) with the following command
cscript xmlaProcess.vbs Sandpit http://locahost/sql05/msmdpump.dll
In order to run this script from your environment all you need to do is:
copy and paste the following script to a file called xmlaProcess.vbs
If it is not already configured you will need to setup HTTP access on your server
(see here for information on how to configure AS 2005 for HTTP access: http://www.microsoft.com/technet/prodtechnol/sql/2005/httpasws.mspx)
and then run it from the command line by executing
cscript xmlaProcess.vbs (as a user with Admin rights)
Have Fun!
'// Create XMLHTTP instance
Dim oHttp
Dim lResolve
Dim lConnect
Dim lSend
Dim lReceive
Dim sUrl, sXmlaProcessCmd, sXmlaPre, sXmlaPost
Dim sDatabase, sXmlaIf wscript.arguments.count = 2 then
sDatabase = wscript.arguments(0)
sUrl = wscript.arguments(1)
Else
wscript.echo "You must specify the parameters in order to run this script"
wscript.quit(1)
End IfSet oHttp = CreateObject("MSXML2.ServerXMLHTTP.4.0")
lResolve = 60 * 1000
lConnect = 60 * 1000
lSend = 60 * 1000
lReceive = 60 * 1000
oHttp.setTimeouts lResolve, lConnect, lSend, lReceive
oHttp.open "POST", sUrl, false
oHttp.setRequestHeader "Content-Type", "text/xml; charset=""UTF-8"""
oHttp.setRequestHeader "SOAPAction", """urn:schemas-microsoft-com:xml-analysis:Execute"""
sXmlaPre = "" _
& "" _
& ""
sXmlaPost = "" _
& "