<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>TSSASM</title><link>http://www.codeplex.com/TSSASM/Project/ProjectRss.aspx</link><description>Using Transact SQL for browsing and managing Analysis Services 2005 Metadata</description><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=20</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services 2005 Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
1. Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS 2005 objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
2. Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),
createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),
aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),
estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),
datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),
remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),
errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),
errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),
errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
3. Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy it directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 31 May 2008 18:02:35 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080531060235P</guid></item><item><title>CREATED ISSUE: Resultset of function growth with every call</title><link>http://www.codeplex.com/TSASSM/WorkItem/View.aspx?WorkItemId=6119</link><description>In my environment the resultset of SELECT &amp;#42; FROM SSASPartitions&amp;#40;&amp;#39;Server&amp;#39;,&amp;#39;Database&amp;#39;&amp;#41; growth every time.&lt;br /&gt;The function never forgets the last result set and adds every new resultset at the end.&lt;br /&gt;W2003 Ent Eng., 64-Bit&lt;br /&gt;</description><author>kjh24</author><pubDate>Tue, 06 May 2008 13:55:12 GMT</pubDate><guid isPermaLink="false">CREATED ISSUE: Resultset of function growth with every call 20080506015512P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=19</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
1. Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS 2005 objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
2. Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
3. Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy it directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:36:13 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310053613P</guid></item><item><title>UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008)</title><link>http://www.codeplex.com/TSSASM/Release/ProjectReleases.aspx?ReleaseId=11545</link><description>This first release is intended to be proof of concept and it has only one SSAS 2005 metadata retrieving function&amp;#58; SSASPartitions.&lt;br /&gt;See Home tab to get detailed steps for installation and using.&lt;br /&gt;Other SSAS 2005 metadata object will be able to be browsed in future releases.&lt;br /&gt;&lt;br /&gt;</description><author></author><pubDate>Mon, 10 Mar 2008 17:35:21 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008) 20080310053521P</guid></item><item><title>RELEASED: TSSASM v0.1 beta (Mar 10, 2008)</title><link>http://www.codeplex.com/TSSASM/Release/ProjectReleases.aspx?ReleaseId=11545</link><description>This first release is intended to be proof of concept and it has only one SSAS 2005 metadata retrieving function&amp;#58; SSASPartitions.&lt;br /&gt;See Home tab to get detailed steps for installation and using.&lt;br /&gt;Other SSAS 2005 metadata object will be able to be browsed in future releases.&lt;br /&gt;&lt;br /&gt;</description><author></author><pubDate>Mon, 10 Mar 2008 17:35:21 GMT</pubDate><guid isPermaLink="false">RELEASED: TSSASM v0.1 beta (Mar 10, 2008) 20080310053521P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=18</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
1. Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
2. Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
3. Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy it directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:19:30 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310051930P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=17</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index:&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
1. Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
2. Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
3. Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy it directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:17:09 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310051709P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=16</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
1. Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
2. Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
3. Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy the project directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:16:13 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310051613P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=15</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Index&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;&lt;li&gt;Binary Installation&lt;/li&gt;&lt;li&gt;Deploying from Visual Studio&lt;/li&gt;
&lt;/ol&gt; &lt;br /&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy the project directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Build and deploy project.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:15:17 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310051517P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSSASM/Wiki/View.aspx?title=Home&amp;version=14</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSSASM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Binary Installation 
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Deploying from Visual Studio
&lt;/h1&gt; &lt;br /&gt;If you've just downloaded source code and you edited project you can deploy the project directly from Visual Studio:&lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Follow steps 1, 2, and 3 from Binary Installation section above so as to set security configuration.&lt;br /&gt;&lt;b&gt;2&lt;/b&gt; Open project properties and select the Database Tab. &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Set the appropiate connection string where assembly will be deployed. &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 17:13:07 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310051307P</guid></item><item><title>UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008)</title><link>http://www.codeplex.com/TSASSM/Release/ProjectReleases.aspx?ReleaseId=11545</link><description>This first release is intended to be proof of concept and it has only one SSAS metadata retrieving function&amp;#58; SSASPartitions.&lt;br /&gt;See Home tab to get detailed steps for installation and using.&lt;br /&gt;Other SSAS metadata object will be able to be browsed in future releases.</description><author></author><pubDate>Mon, 10 Mar 2008 17:03:43 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008) 20080310050343P</guid></item><item><title>UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008)</title><link>http://www.codeplex.com/TSASSM/Release/ProjectReleases.aspx?ReleaseId=11545</link><description>This first release has only one TSSASM function&amp;#58; SSASPartitions.&lt;br /&gt;See Home tab to get detailed steps for installation and using.&lt;br /&gt;Other SSAS metadata object will be able to be browsed in future releases.</description><author></author><pubDate>Mon, 10 Mar 2008 16:57:30 GMT</pubDate><guid isPermaLink="false">UPDATED RELEASE: TSSASM v0.1 beta (mar 10, 2008) 20080310045730P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=13</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with a large amount of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but this project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;This first release component has limited functionality as only browse partition objects (SSASPartitions function). Additional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Installation
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly in SQL Server so as to allow CLR reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has methods not supported with SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function. Hope this help you.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Mon, 10 Mar 2008 16:54:31 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080310045431P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=12</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Using Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Introduction
&lt;/h2&gt; &lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Installation
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:54:38 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308115438P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Transact Sql Server Analysis Services Metadata
&lt;/h1&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;h1&gt;
Installation
&lt;/h1&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:51:35 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308115135P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Heading 1 
&lt;/h1&gt;Transact Sql Server Analysis Services Metadata&lt;br /&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:48:35 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308114835P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Heading 1 Transact Sql Server Analysis Services Metadata ! Heading 1
&lt;/h1&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:44:46 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308114446P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Heading 1&lt;b&gt;Transact Sql Server Analysis Services Metadata&lt;/b&gt;
&lt;/h1&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:43:25 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308114325P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Transact Sql Server Analysis Services Metadata&lt;/b&gt;&lt;br /&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after large and complex processing batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but thsi project proposes to use SQL Server in the opposite way as well:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us to fastly answer, for example, several issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new feature.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
 
ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON 
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:37:42 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308113742P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/TSASSM/Wiki/View.aspx?title=Home&amp;version=6</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Transact Sql Server Analysis Services Metadata&lt;/b&gt;&lt;br /&gt;Transact SQL for browsing and managing Analysis Services Metadata
&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;***&lt;br /&gt;Managing SSAS objects when facing scenarios with lots of cubes (let's say more than a dozen) and lots of partitions (let's say thousands) is not an easy job to deal with.&lt;br /&gt;When trying to control partition states and cube consistency after processing large and complex batches became a costly job and not allways as exact as process quality control requirements need.&lt;br /&gt;SSAS uses SQL Server relational tables as cube data source but I propose to use also SQL Server in the opposite way:  as the ideal tool to browse all data about SSAS metadata objects.&lt;br /&gt;Using T-SQL as the query language can help us answer, for example, the some issues about partition processing:&lt;br /&gt; &lt;br /&gt;1) Are there partitions that have not been processed ?&lt;br /&gt;2) are all partitions created after closing period ?&lt;br /&gt;3) How many partitions has aggregation designed ?&lt;br /&gt;4) Which aggregation design are asigned ?&lt;br /&gt;5) List all partitions that has a certain slice.&lt;br /&gt;6) Check if all partitions has the same data source.&lt;br /&gt;7) Want to document all objects and its properties and want to get document updated when an object is changed.&lt;br /&gt; &lt;br /&gt;We can query SSAS object using Transact-SQL query language through SQL Server 2005 CLR  (Common Language Runtime) new functionality.&lt;br /&gt;The idea is create a .NET CLR assembly that access SSAS through AMO; then it will provide rows to a table value function (TVF) that can be queried using a T-Sql SELECT statement.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;b&gt;Limitations&lt;/b&gt;&lt;br /&gt;&lt;u&gt;Component has limited functionality as only browse partition objects (SSASPartitions function). Aditional functions will be added in future releases&lt;/u&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Usage sample 1: knowing all partitions in a certain SSAS Catalog:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29443" alt="Sample01.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;Usage sample 2: knowing all partitions of measure group &amp;quot;Internet Sales&amp;quot; that have &amp;quot;molap&amp;quot; storage:&lt;br /&gt; &lt;br /&gt;&lt;img src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=TSASSM&amp;amp;DownloadId=29444" alt="Sample02.jpg" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Installation&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;CLR feature must be activated in the SQL Server 2005 instance. Follow these steps to make binary works:&lt;br /&gt; &lt;br /&gt;&lt;b&gt;1&lt;/b&gt; Activate SQL Server CLR. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
EXEC sp_configure 'show advanced options' , '1';
go
reconfigure;
go
EXEC sp_configure 'clr enabled' , '1'
go
reconfigure;
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;2&lt;/b&gt; SQL Server instance must trust database and its content. Only a user with sysadmin server role can do it.&lt;br /&gt; &lt;br /&gt;&lt;span class="codeInline"&gt; ALTER DATABASE &amp;lt;Your database&amp;gt; SET TRUSTWORTHY ON &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;b&gt;3&lt;/b&gt; Analysis Services Management Object assembly must be registered firstly so as to allow CLR can reference it&lt;br /&gt;   &lt;u&gt;Must be registered as unsafe because it has method not supported in SAFE and EXTERNAL_ACCESS permission types.&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
Use &amp;lt;Your database&amp;gt;
CREATE ASSEMBLY MicrosoftAnalysisServices
FROM '&amp;lt;Path&amp;gt;\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.AnalysisServices.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;4&lt;/b&gt; Create a new assembly that references TSSASM dll:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
CREATE ASSEMBLY TSSASM
FROM '&amp;lt;Path&amp;gt;\TSSASM.dll'
WITH PERMISSION_SET = UNSAFE
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;5&lt;/b&gt; Create a table function that references the CLR function&lt;br /&gt;	&lt;u&gt;Note: table definition cannot be changed, it must be exactly the same as it is hard coded inside dll&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;
CREATE FUNCTION SSASPartitions(@server nvarchar(100),@catalog nvarchar(100))
RETURNS TABLE 
(cubename NVARCHAR(100),measuregroupname NVARCHAR(100), partitionid NVARCHAR(100), partitionname NVARCHAR(100),createdtimestamp DATETIME,lastprocessed DATETIME,aggregationdesignid NVARCHAR(100),aggregationdesignname NVARCHAR(100),aggregationdesignaggrscount INT,aggregationdesignestperfgain INT,slice NVARCHAR(100),estimatedsize BIGINT,estimatedrows BIGINT,storagemode NVARCHAR(100),storagelocation NVARCHAR(100),processingmode NVARCHAR(100),datasourcename NVARCHAR(100),datasourceconn NVARCHAR(255),datasourceviewname NVARCHAR(100),remotedatasourcename NVARCHAR(100),remotedatasourceid NVARCHAR(100),description NVARCHAR(100),errconfkeyerrorlogfile NVARCHAR(100),errconfkeyduplicate NVARCHAR(100),errconfkeyaction NVARCHAR(100),errconfkeyerrorlimit BIGINT,errconfkeyerrorlimitaction NVARCHAR(100),errconfkeynotfound NVARCHAR(100),errconfnullkeyconvtounknown NVARCHAR(100),errconfnullkeynotallowed NVARCHAR(100))
AS 
EXTERNAL NAME TSSASM.CLRFunctions.SSASPartitions
&lt;/pre&gt; &lt;br /&gt;&lt;b&gt;6&lt;/b&gt; Try function.&lt;br /&gt; &lt;br /&gt; ***&lt;br /&gt; &lt;br /&gt;This project is currently in setup mode and only available to project coordinators and developers. Once you have finished setting up your project you can publish it to make it available to all CodePlex visitors.&lt;br /&gt; &lt;br /&gt;There are three requirements before you publish:&lt;br /&gt; &lt;br /&gt;- Edit this page to provide information about your project&lt;br /&gt;- Upload the initial source code for your project&lt;br /&gt;- Add your project license&lt;br /&gt; &lt;br /&gt;Additional information on starting a new project is available here: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=CodePlex&amp;amp;title=CodePlex%20Project%20Startup%20Guide" class="externalLink"&gt;Project Startup Guide&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;/div&gt;</description><author>Ltubia</author><pubDate>Sat, 08 Mar 2008 23:30:47 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20080308113047P</guid></item></channel></rss>