Published on

February 4, 2020

Executing Commands and Manipulating OLAP Cubes in SQL Server

When working with OLAP cubes in SQL Server, there are various operations that we may need to perform, such as cube and partition processing, executing administrative tasks, and performing analysis. To run these operations, we can use three query languages: multidimensional expressions (MDX), data mining expressions (DMX), and XML for Analysis (XMLA).

In SQL Server Management Studio, we can write and execute these queries. However, there are times when we need to implement them within a flow that executes other tasks over other services, such as the database engine or file system. This is where Integration Services (SSIS) comes in.

In SSIS, there are three tasks and two components that can be used to execute commands over SQL Server Analysis Services (SSAS):

  • Analysis Services Processing Task
  • Analysis Services Execute DDL Task
  • Data Mining Query Task
  • Dimension Processing component
  • Partition Processing component

The Analysis Services Processing Task allows us to process analysis services objects, such as OLAP cubes and dimensions. After adding this task to the package control flow, we can configure the processing job by selecting the appropriate connection manager, specifying the objects to process, and setting the processing approach.

The Analysis Services Execute DDL Task, on the other hand, is used to manipulate SSAS OLAP Cubes by executing Data Definition Language (DDL) statements written in the XMLA language. This task is similar to the Execute SQL Task used for executing SQL commands over a database. We can specify the connection manager, the source type of the DDL statement, and the actual DDL statement to be executed.

Both tasks provide a way to connect to an SSAS instance using the OLE DB Connection Manager. This connection manager uses the Microsoft OLE DB for Analysis Services provider. By configuring the connection manager, we can specify the SSAS server, authentication method, and analysis database.

It is worth mentioning that in some cases, we may need to pass dynamic XMLA commands. This can be achieved by using expressions. We can build the XMLA command dynamically and store it within a variable. Then, we can evaluate the “Processing commands” property of the Analysis Services Processing Task or the “Source” property of the Analysis Services Execute DDL Task as an expression using this variable.

By utilizing these tasks and components in SSIS, we can effectively manipulate OLAP cubes and execute commands over SSAS. This provides us with the flexibility to integrate these operations within a larger workflow that involves other services and tasks.

In conclusion, understanding how to connect to an SSAS instance using SSIS and utilizing the Analysis Services Processing Task and Analysis Services Execute DDL Task can greatly enhance our ability to execute commands and manipulate OLAP cubes in SQL Server. These tasks, along with other related tasks and components, provide a comprehensive set of tools for working with SSAS.

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.