How to make the SSAS server as a linked server on my laptop

Validating the project on http://www.mssqltips.com/sqlservertip/2790/dynamic-xmla-using-tsql-for-sql-server-analysis-services/

Step 0. Download the project files, unzip them, deploy the solution first. If you see deployment errors, fix them as suggested here.

Step 1. In SSMS 2012, add a linked server as below:

  1. name: SSAS
  2. provider - MS OLEDB Provider for Analysis Services 10
  3. product name - SQLServerSSAS (whatever, just make sure no space)
  4. data source - localhost\SQL2012 (not localhost/SQL2012, be careful)
  5. server option changes: set RPC and RPC Out true (a must!)

Step 2. Verify the linked server works

2.1 - Run the following entire code in SSMS (not in SSAS)

--This is an example on dynamic XMLA using T-SQL for SQL Server Analysis Services, adding a new partition based on the year of getdate().

Declare @myXMLA nvarchar(max),
    @value nvarchar(30),@date varchar(8),@year nvarchar(4)
       
        set @date=FORMAT (getdate(), 'yyyyMMdd')
        set @year=FORMAT (getdate(), 'yyyy')
        select @value='Internet_Sales_'+FORMAT (getdate(), 'yyyy')       

Set @myXMLA =N'<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <ParentObject>
        <DatabaseID>AdventureWorksDW2012Multidimensional-EE</DatabaseID>
        <CubeID>Adventure Works</CubeID>
        <MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
    </ParentObject>
    <ObjectDefinition>
        <Partition 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">
            <ID>'+@value+'</ID>
            <Name>'+@value+'</Name>
            <Source xsi:type="QueryBinding">
                <DataSourceID>Adventure Works DW</DataSourceID>
                <QueryDefinition>SELECT [dbo].[FactInternetSales].[ProductKey],[dbo].[FactInternetSales].[OrderDateKey],[dbo].[FactInternetSales].[DueDateKey],[dbo].[FactInternetSales].[ShipDateKey], [dbo].[FactInternetSales].[CustomerKey], [dbo].[FactInternetSales].[PromotionKey],[dbo].[FactInternetSales].[CurrencyKey],[dbo].[FactInternetSales].[SalesTerritoryKey],[dbo].[FactInternetSales].[SalesOrderNumber],[dbo].[FactInternetSales].[SalesOrderLineNumber],[dbo].[FactInternetSales].[RevisionNumber],[dbo].[FactInternetSales].[OrderQuantity],[dbo].[FactInternetSales].[UnitPrice],[dbo].[FactInternetSales].[ExtendedAmount],[dbo].[FactInternetSales].[UnitPriceDiscountPct],[dbo].[FactInternetSales].[DiscountAmount],[dbo].[FactInternetSales].[ProductStandardCost],[dbo].[FactInternetSales].[TotalProductCost],[dbo].[FactInternetSales].[SalesAmount],[dbo].[FactInternetSales].[TaxAmt],[dbo].[FactInternetSales].[Freight],[dbo].[FactInternetSales].[CarrierTrackingNumber],[dbo].[FactInternetSales].[CustomerPONumber]
               FROM [dbo].[FactInternetSales]
                                WHERE OrderDateKey &lt;= '''+@date+'''</QueryDefinition>
            </Source>
            <StorageMode>Molap</StorageMode>
            <ProcessingMode>Regular</ProcessingMode>
            <ProactiveCaching>
                <SilenceInterval>-PT1S</SilenceInterval>
                <Latency>-PT1S</Latency>
                <SilenceOverrideInterval>-PT1S</SilenceOverrideInterval>
                <ForceRebuildInterval>-PT1S</ForceRebuildInterval>
                <AggregationStorage>MolapOnly</AggregationStorage>
                <Source xsi:type="ProactiveCachingInheritedBinding">
                    <NotificationTechnique>Server</NotificationTechnique>
                </Source>
            </ProactiveCaching>
            <EstimatedRows>1013</EstimatedRows>
            <AggregationDesignID>Internet Sales 1</AggregationDesignID>
        </Partition>
    </ObjectDefinition>
</Create>' 

Exec (@myXMLA) At MSOLAP;

2.2 - Go to SSAS, verify the new partition Internet_Sales_2013 is added