11.3. COM User-Defined Functions

COM is Microsoft's architecture for building software from binary components that expose functionality with a well-defined interface. Analysis Services understands COM components and has the ability to use COM DLLs so that functions within the DLL can be accessed through MDX. To create a new function that will perform a customized operation for your business, we recommend you use .NET stored procedures. However, if you already have a COM DLL that provides the functionality you need, you can still use it in Analysis Services 2008. This section helps you use existing COM UDFs in Analysis Services 2008.

11.3.1. Adding a COM UDF to an Analysis Services Database

To use a COM UDF in MDX queries, you must add it to an Analysis Services database. You do this the same way as with .NET stored procedures by using SQL Server Management Studio and simply setting the Type of the assembly to COM DLL. As with .NET UDFs, you can add a COM UDF to Analysis Services at the scope of the Analysis Services instance or at the scope of an existing database. If your UDF is added at the server scope, it can be shared across multiple databases similar to the Excel and VBA DLLs that default to server-level scope.

All COM assemblies added to Analysis Services have unrestricted permissions, which means they can access files or network services in addition to any computation. Code access security is only available for .NET assemblies. As a result, you should only add COM assemblies ...

Get Professional Microsoft® SQL Server® Analysis Services 2008 with MDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.