ASCMD.exe for SSAS 2008


I think there is a bug in the Command Line sample utility provided with SQL Server 2008 for running xmla commands against the SSAS instance. We have used the similar utility for SQL Server 2005 to run a XMLA command without any issues. But when I tried to do the same with the utility provided as a sample with SQL Server 2008, I ran into issues. Having debugged it, I narrowed the problem. There is a provision in the utility to run multiple xmla commands separated by “GO”. The 2005 utility regex looked for exact characters ‘GO” to create batches, however 2008 utility regex looks for any characters that end with “GO” characters. Therefore our XMLA was being incorrectly parsed into batches by occurrences of captions containing “go”. E.g <Caption>Código de pago</Caption>.
Once I changed the regex from
const string BatchRegex = @"^[\w\W]*?[\r\n]go\s";
const string BatchRegex = @"^[\w\W]
The utility now can execute the xmla correctly.