Empty Affairs

If you have a cube with large dimensions you may have come across the following error:

The expression contains a function that cannot operate on a set with more than 4,294,967,296 tuples.

The culprit is the NON EMPY (or NonEmpty), as mentioned in the Chris Webb’s blog and Mosha Passumansky’s blog. It turns out that NonEmpty simply gives up when the number of tupples in the cross-join members exceeds 4GB. The problem is all Microsoft SSAS clients (Excel, Reporting Services, Report Builder, etc.) are blissfully unaware of the trap to come and would happily cross-join dimension members as you add more dimensions to the report. Take for example the following (simplified) query produced by the Report Designer when the report shows the customer name and its accounts:

SELECT NON EMPTY { [Measures].[Sales] } ON COLUMNS,
NONEMPTY { ([Customer].[Customer].[Customer].ALLMEMBERS *
[Account].[Customer Account Number].[Customer Account Number].ALLMEMBERS)} ON ROWS
FROM <some cube>
WHERE ([Date].[Date].&[20070712])

In my case, the server returned the 4GB error with about 150,000 customers and 200,000 customer accounts. I can think of two approaches to avoid this error:

  1. Use Autoexists – Consider placing the frequently-queried large attribute hierarchies in the same dimension. Not only this may avoid the error but also it may give you better performance since the server knows how to cross-join attribute hierarchies within the same dimension efficiently. Let’s say you can add the Customer attribute to the Account dimension so it exists both in the Customer and Account dimensions. This query executes successfully:

    SELECT NON EMPTY { [Measures].[Sales] } ON COLUMNS,
    NONEMPTY { ([Account].[Customer].[Customer].ALLMEMBERS *
    [Account].[Customer Account Number].[Customer Account Number].ALLMEMBERS)} ON ROWS
    FROM <some cube>
    WHERE ([Date].[Date].&[20070712])

  2. Reduce large sets with Exists() before NonEmpty()

    SELECT NON EMPTY { [Measures].[Sales] } ON COLUMNS,
    NONEMPTY { ([Customer].[Customer].[Customer].ALLMEMBERS *
    Exists([Account].[Customer Account Number].[Customer Account Number].ALLMEMBERS, [Date][Date].CurrentMembers, “<Measure Group Name>”)} ON ROWS
    FROM <some cube>
    WHERE ([Date].[Date].&[20070712])

In this case, the Exists function returns only the customer accounts that have data in the measure group for the date requested. The net result is that you pass a much smaller set of accounts to the NonEmpty function.

SQL Server 2008 (Katmai) to Launch February 28th 2008

From the latest MS press release “In anticipation for the most significant Microsoft enterprise event in the next year, Turner announced that Windows Server 2008, Visual Studio 2008 and Microsoft SQL Server 2008 will launch together at an event in Los Angeles on Feb. 27, 2008, kicking off hundreds of launch events around the world.”

Whoa, I didn’t expect Katmai so soon. Well, Euan Garden is telling us that a marketing launch doesn’t mean all that much after all [;)]. It will probably be a few more months before Katmai RTMs.

SSRS Setup Woes

I was setting up Reporting Services 2005 today on a clean Windows XP machine and I came across the infamous error:

The report server has encountered a configuration error. See the report server log files for more information. (rsServerConfigurationError). Access to the path ‘c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\RSReportServer.config’ is denied.

Here is how I fixed this horrible problem. First, I open the Computer Manager and verified that the following two groups exist: SQLServer2005ReportingServicesWebServiceUser$<machinename>$MSSQLSERVER and SQLServer2005ReportServerUser$<machinename>$MSSQLSERVER.

Next, I used the Windows Explorer to verify that these groups have read ACL permissions to the Report Server folder (C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer) by right-clicking on the this folder and checking the Security tab. Finally, I verified that the following users have been assigned to these groups.

  • SQLServer2005ReportingServicesWebServiceUser$<machinename>$MSSQLSERVER should have the ASP.NET account assigned to it. In Windows XP, the default ASPNET account is <MachineName>\ASPNET. In Windows Server 2003 and Vista, this should be the built-in NT AUTHORITY\Network Service account.
  • The SQLServer2005ReportServerUser$<machinename>$MSSQLSERVER should have the account the SSRS Windows Service is running under, e.g.; NT Authority\SYSTEM, if it is running under local system.

In my case, the issue was caused by the fact that for some obscure reason, the SQL Server setup program had added <domain>\ASPNET to SQLServer2005ReportingServicesWebServiceUser$<machinename>$MSSQLSERVER instead of the local ASPNET account. So, I removed this account and added machinename\ASPNET. This took care of rsServerConfigurationError.

Since I wanted to use my old ReportServer database I followed the steps in this KB article to restore it over the existing catalog database. But then when I browse to localhost/reportserver I had another error that SSRS cannot connect to the ReportServer database because login failed for the ASPNET account. So, I tried the Reporting Services Configuration utility and hit the Apply button on the Database tab but I got an error status message that the ASPNET account already exists in the ReportServer database. To solve this error, I used SQL Server Management Studio to drop the existing ASPNET logins and associated schemas from the ReportServer and ReportServerTemp databases and hit the Apply button on the Database tab in the Reporting Services Configuration utility again.

How to install SQL Server 2005 Reporting Services on a Windows Vista-based computer

I spent a couple of hours today trying to get SSRS 2005 working on Vista. I was getting the infamous IIS 500 error when browsing the Report Manager (http://localhost/reports) and Report Server (http://localhost/reportserver) virtual roots. I triple-verified the Brian Welcker’s recommendations and the Vista considerations in the SQL Server 2005 readme file. I couldn’t figure what’s going on especially given the fact that I installed SSRS on my home Vista machine with no problems. The only difference this time was that I performed file-only install of SSRS because I wanted to use an existing report catalog. In a moment of a Google eureka, I came across the How to install SQL Server 2005 Reporting Services on a Windows Vista-based computer KB article. It turned out that the Reporting Services Configuration Utility put the IIS applications in the default application pool which in IIS 7.0 is running in Integrated Managed Pipeline Mode. I created a new ReportServer application pool in Classic Managed Pipeline Mode, put the ReportServer and Reports applications in, and the issue went away.