Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you run Multiple XMLA Alter Commands at the same time?

Tags:

ssms

ssas

I have the following two XMLA alter commands that individually work fine. I would like to run them at the same time in SQL Management studio. I have tried wrapping them in command, batch, and a number of other elements. I can't seem to get anything to work correctly.

<Alter AllowCreate="true" ObjectExpansion="ObjectProperties" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <Object>
        <DatabaseID>DB1</DatabaseID>
        <RoleID>Role</RoleID>
    </Object>
    <ObjectDefinition>
        <Role xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400">
            <ID>Role</ID>
            <Name>ReadersRole</Name>
            <Members>
                <Member>
                    <Name>Domain\ReaderUserName</Name>
                </Member>
            </Members>
        </Role>
    </ObjectDefinition>
</Alter>


<Alter AllowCreate="true" ObjectExpansion="ObjectProperties" xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <Object>
        <DatabaseID>DB2</DatabaseID>
        <RoleID>Role</RoleID>
    </Object>
    <ObjectDefinition>
        <Role xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300" xmlns:ddl400="http://schemas.microsoft.com/analysisservices/2012/engine/400" xmlns:ddl400_400="http://schemas.microsoft.com/analysisservices/2012/engine/400/400">
            <ID>Role</ID>
            <Name>ReadersRole</Name>
            <Members>
                <Member>
                    <Name>Domain\ReaderUserName</Name>
                </Member>
            </Members>
        </Role>
    </ObjectDefinition>
</Alter>
like image 352
leemicw Avatar asked Aug 04 '15 21:08

leemicw


People also ask

How do I run an XMLA script?

You can run your xmla query on Management Studio in File->New-> Analysis Services XMLA query. If you want to automate it you can run that query in an Analysis Services Execute DDL Task in SSIS and then you can schedule it on a job. You can do a lot of things programmatically.

What is Xmla in SSAS?

XML for Analysis (XMLA) is a SOAP-based XML protocol, designed specifically for universal data access to any standard multidimensional data source that can be accessed over an HTTP connection. SQL Server Analysis Services uses XMLA as its only protocol when communicating with client applications.


1 Answers

Can you try just putting a

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"></Batch>

tag around them?

like image 170
GregGalloway Avatar answered Sep 23 '22 17:09

GregGalloway