Book Review: Expert Cube Development with Microsoft SQL Server 2008 Analysis Services

I spent last week on campus in Redmond with the SQL Server Analysis Services Maestro program. It was great to have a chance to focus on SSAS for a week. As part of that, I did quite a bit of reading as I had quite a bit of travelling time. Ironically, I re-read a few books.

The first was Marco Russo, Alberto Ferrari and Chris Webb's book Expert Cube Development with Microsoft SQL Server 2008 Analysis Services. I've often told BI classes that I've been teaching that this is a really good book and highly recommended. Re-reading it confirmed that. I thoroughly enjoyed reading it again.

I can't say that I agree with every conclusion that Marco, Alberto and Chris came to, but I really appreciated the tone of the book where they make direct recommendations about how to do things, rather than endlessly messing around with "it depends" types of comments. Often, readers just want an opinion on what to do, even if it's not the only opinion.

I'm not sure that the book is at the "Expert" level but it provides a very sound coverage of Analysis Services. There are only two areas where I would love to see some changes. First, while the AS material is great, the more they step into the relational engine aspects, the shakier the material gets. For example, they discuss that disk queue lengths greater than 2 are a problem. While that was an indication to consider back when we mostly worked with DAS based systems, in most SAN-based environments, this simply isn't correct advice.

Second, I hope the guys push the publisher (PackT Publishing) to make their book available in Kindle format. It was the only book that I took with me on this trip where I needed to carry the hard-copy book.

Regardless, it's a great book and should be on the shelf of anyone working with Analysis Services 2008. Highly recommended!

SQL Server 2008 R2 Cumulative Update 8 now available

CU8 is now available for SQL Server 2008 R2. You will find it here: http://support.microsoft.com/kb/2534352/en-us

It includes the following fixes:

VSTS bug number KB article number Description
726734 2522893 (http://support.microsoft.com/kb/2522893/ ) FIX: A backup operation on a SQL Server 2008 or SQL Server 2008 R2 database fails if you enable change tracking on this database
730658 2525665 (http://support.microsoft.com/kb/2525665/ ) FIX: SQL Server 2008 BIDS stops responding when you stop debugging a SSIS 2008 or a SSIS 2008 R2 package
639374 2525665 (http://support.microsoft.com/kb/2525665/ ) FIX: SQL Server 2008 BIDS stops responding when you stop debugging a SSIS 2008 or a SSIS 2008 R2 package
701471 2530913 (http://support.microsoft.com/kb/2530913/ ) FIX: "Error: 17066" occurs when you create a partitioned nonclustered index in SQL Server 2008 R2 if a parallel execution plan is used
708511 2535660 (http://support.microsoft.com/kb/2535660/ ) FIX: Role membership is synchronized even if the SynchronizeSecurity element is set to the SkipMembership value in SSAS 2008 or in SSAS 2008 R2
711297 2537467 (http://support.microsoft.com/kb/2537467/ ) FIX: You cannot use SQL Server Management Objects (SMO) to transfer data from a table in SQL Server 2008 or in SQL Server 2008 R2
713677 2539098 (http://support.microsoft.com/kb/2539098/ ) FIX: "Runtime error: the property DBPROP_MSMD_UPDATE_ISOLATION_LEVEL cannot be found" error when an application tries to create a connection to SSAS 2008 R2
702342 2539378 (http://support.microsoft.com/kb/2539378/ ) FIX: Replmerg.exe crashes when it enumerates changes to a statement in SQL Server if the stored procedure contains more than 4,000 characters
720633 2545989 (http://support.microsoft.com/kb/2545989/ ) FIX: "A time-out occurred while waiting for buffer latch" error when many transactions concurrently update a database in SQL Server 2008 R2 if the database uses the snapshot isolation level
721958 2547017 (http://support.microsoft.com/kb/2547017/ ) FIX: Instances of DAX functions that have no names incorrectly appear when you add a calculated member to a report that uses an SSAS 2008 R2 database as a data source
737837 2559662 (http://support.microsoft.com/kb/2559662/ ) FIX: Slow performance when you render a report that returns a long string of text in SSRS 2008 R2 if the text contains no carriage return characters
738049 2562753 (http://support.microsoft.com/kb/2562753/ ) FIX: Slow performance when an MDX query uses unary operators on parent/child hierarchy members in SSAS 2008 R2 if you define a scope calculation on these members and if the query accesses multiple dates in a time dimension
722165 2563216 (http://support.microsoft.com/kb/2563216/ ) FIX: Dynamic image does not work in a page header or footer in SSRS 2008 R2 if the value expression uses the Global!PageNumber variable
704879 2563924 (http://support.microsoft.com/kb/2563924/ ) FIX: "The incoming tabular data stream (TDS) protocol stream is incorrect" error when the SQLPutData function inserts the SQL_NULL_DATA value in a TVP in SQL Server 2008 R2

Review: Kindle (Amazon)

Since I've been posting book reviews, I've already had a few questions about the Kindle and what I think about it.

I have the 9" DX with 3G and love it. The 3G is so useful. You don't need to have a 3G provider account and it just seems to work almost everywhere I travel to (including even China). I'm not sure how Amazon make that work but it's great. I see a book, click to order it and moments later the book is on my Kindle.

The other big advantage is that it holds so many books. I've got a good library but it's at home and I'm travelling a lot. I now keep the books I use most on the Kindle instead and it's always with me. That's a huge advantage.

I find the 6" device screens too small. I'm sure I'm getting old and eyesight isn't what it used to be but technical books on 6" screens just don't work for me. A novel might be ok but not a technical book. The up-side of the 6" device is that I've seen people put them into their pockets. You won't do that with the 9" device unless you have really big pockets. It's more like an A4 sheet of paper.

I like the way that I can email a PDF to my Kindle and it's delivered through the 3G whispernet. There's a small charge but it's very useful and the options for controlling charging are great. While you can change font sizes, etc. for Kindle-format books, you can't do that for PDFs that you send to it.

The other reason I like the Kindle rather than say an iPad, is the electronic paper screen. I only charge my Kindle once every few weeks and the screen is a joy to read. It basically only draws power when you turn the page. By comparison, the iPad and other such devices have an active screen and I find them very hard on the eyes after a reasonably short time. By comparison, I can read the Kindle all day without an issue. Unlike the Kindle, active devices also need constant charging to be useful.

If you get a Kindle, you need a cover for it. I got the Belkin Neoprene cover from Amazon. It's excellent also.

The downside of the Kindle? You really will be buying your books from Amazon and not all titles are available in Kindle format. But I've found that availability is getting much better almost daily in the technical book space.

If you want to read old classic books as well, there are a *really* large number of them available in the Kindle store for free.

Overall, I couldn't imagine life without my Kindle now.

Book Review: Dreaming in Chinese – Deborah Fallows

Another book that I've just finished reading on the Kindle is Dreaming in Chinese by Deborah Fallows. I had purchased the hard cover edition a while back on the recommendation of colleague Ron Talmage but hadn't got to reading it. I was glad to then see the Kindle edition of the book appear. I purchased and read it and loved it.

Deborah spent three years recently living in Shanghai and has documented many of the struggles she had with coming to terms with learning Mandarin and with getting used to Chinese society. I imagine that part of the hassle she would have had was dealing with Shanghai-ese rather than the Mandarin that she would have learned before heading off to China but I could relate so well to so many things she spoke of.

The book is also quite funny. I particularly liked the part where Deborah described trying to talk to an employee (who was wearing a big sombrero) outside a Taco Bell restaurant. She wanted to know if they offered take-away food but her attempts to pronounce the words (even though she had the correct words) ranged from asking for a big hug, to discussing hail.

My favorite part was where she discussed Chinese names. Chinese people will often adopt English names when they move to an English-speaking country, and of course, English-speaking people will often adopt Chinese names when they move to a Chinese-speaking country. The most common way to do this is to try to find a set of Chinese words that are like a transliteration of your existing English name. But it's also important to try to find words that mean something sensible in Chinese, like "Harmony". Deborah made me laugh out loud when describing one of her young friend's boyfriend who decided to choose a name to ward off gui (or evil spirits). He chose the name Fendui. Unfortunately, while it sounded like his name, it directly translated to "pile of shit". Beautiful!

If you have any interest in understanding Chinese society, even if you don't want to tackle Mandarin, this book is a great read. Highly recommended! (10 out of 10)

Book Review: Microsoft PowerPivot for Excel 2010: Give Your Data Meaning

I'm loving my Kindle. I seem to be getting through books so much faster. One book that I recently read was Book Review: Microsoft PowerPivot for Excel 2010: Give Your Data Meaning by Marco Russo and Alberto Ferrari.

I really liked this book. It provided quite good coverage of PowerPivot use in Excel 2010 and also spent some time mapping the use of PowerPivot to organizational requirements. Marco and Alberto provided more coverage of DAX (Data Analysis Expressions) than I have seen anywhere else, particularly in relation to the CALCULATE verb.

If I have any criticism of the book, it's probably just the order of the chapters. I can imagine that many people won't want to delve so deeply into DAX and may stop reading before they get to the later chapters. I'd like to have seen much of the DAX material at the back of the book as a type of "advanced DAX topics" section, given that the remainder of the book doesn't really depend upon it.

I was left feeling that there's a need for another type of DAX book, much like the book that Art Tennick wrote for MDX: Practical MDX Queries: For Microsoft SQL Server Analysis Services 2008. In that book, Art provides a large number of "recipes" for how to achieve common tasks with MDX. I'm sure that's also needed for DAX.

Anyway, Marco & Alberto's book is definitely recommended.I'd give it 8 out of 10. (And a big thumbs up to the publisher for making a Kindle version available too).

DCL clauses in CREATE SCHEMA

I’ve never been very keen on the option to add additional clauses in the CREATE SCHEMA statement as I’ve seen lots of issues when scripts are executed manually. You get a different outcome, depending upon how you execute it. For example:

 

CREATE SCHEMA SomeSchema AUTHORIZATION Someone

CREATE TABLE Blah (Some table definition);

 

If someone executes the first line on its own, then the second line, the table gets created in their default schema, whereas if they execute the statement as a whole, the table gets created in the new schema. But the one that makes no sense to me is the DCL clause. If I change the above to:

 

CREATE SCHEMA SomeSchema AUTHORIZATION Someone

CREATE TABLE Blah (Some table definition)

GRANT SELECT TO Someoneelse;

 

You would think that the GRANT clause would only ever apply to the newly-created schema. If I executed the above statement, it would grant SELECT on the database instead. The BOL entry: http://msdn.microsoft.com/en-us/library/ms189462.aspx makes even less sense to me. It says

 

grant_statement

Specifies a GRANT statement that grants permissions on any securable except the new schema.

”.

 

What is the point of a GRANT statement that grants permissions on anything *except* the newly-created schema, when the clause is part of the CREATE SCHEMA statement? It then seems even odder that the only example given in BOL specifically grants permissions on the newly-created schema. Anyone know why this is designed this way?

UPDATE against a table-valued function when declared inline

The other day I mentioned to a friend that you could only perform an UPDATE against a table-valued function in T-SQL when the function was declared as an inline TVF. He basically didn't understand the point being made at all. That's not really suprising as the idea of performing an UPDATE against a function does my head in, in terms of everything I ever thought I knew about programming languages.I really don't think it should even be permitted but regardless, here's an example:

 

USE tempdb;

GO

 

CREATE TABLE dbo.TestTable

( TestTableID int,

  TestTableName varchar(20)

);

GO

 

INSERT INTO dbo.TestTable

VALUES (1,'Hello'), (2,'Greg');

GO

 

CREATE FUNCTION dbo.ListGNames()

RETURNS TABLE

AS

RETURN

( SELECT TestTableID, TestTableName

  FROM dbo.TestTable

  WHERE TestTableName LIKE 'G%'

);

GO

 

SELECT * FROM dbo.ListGNames();

GO

 

UPDATE dbo.ListGNames()

SET TestTableName = 'Fred'

WHERE TestTableName = 'Greg';

GO

 

SELECT * FROM dbo.ListGNames();

GO

 

SELECT * FROM dbo.TestTable;

GO

Note that the UPDATE is being performed against the *function* not against the underlying table.

What do you think? Should this behavior even be permitted?

Ola Hallengren's Database Maintenance Scripts

Our buddy Ola Hallengren has released another version of his database maintenance tooling. (Free !) I've seen quite a lot of people using Ola's scripts rather than standard database maintenance plans, and with happy outcomes.

 

In the new version, he has optimized performance in IndexOptimize for databases with large number of indexes or SQL Servers with large number of databases. Ola said that the time for rebuilding or reorganizing indexes is the same, but the time for investigating indexes has been reduced.

 

He also mentioned that he fixed an issue in database backup for databases with very long names (eg SharePoint databases). In the old version you could run into the limitation for the length of a backup device.

 

You'll find info and updates here:

http://ola.hallengren.com/Versions.html

http://ola.hallengren.com/scripts/MaintenanceSolution.sql

 

Skype Error: Exception EXMLDocError in module ezPMUtils.dll at 000E8FCA

Skype sent down an auto-update today. Looks like it's now 5.3.0.111. Regardless, every time I started Skype, it said:

Exception EXMLDocError in module ezPMUtils.dll at 000E8FCA

Reboots, etc. didn't fix it. What did fix it was moving the file ezPMUtils.dll from the folder C:\Program Files (x86)\Skype\Plugin Manager to the folder C:\Program Files (x86)\Skype\Plugin Manager\MLS. Note that at first I tried copying the file to that folder but that did not fix the issue. Moving the file, however, did "fix" the issue in that the error no longer occurs. But of course, the extras manager also no longer functions. It would be really great to see *something* from the people at Skype about this issue.

Hope this helps someone.

It was also very interesting to notice that the auto-update installer still tried to move me across to Google Chrome, away from Internet Explorer. Obviously Skype isn't really integrated into Microsoft yet 🙂

Microsoft EDW Architecture, Guidance and Deployment Best Practices

A team from our company has been working with the SQL product team members and reviewers to produce a series of enterprise data warehouse guidance documents. They cover the following topics:

Chapter 1 – Overview

Chapter 2 – Data Architecture

Chapter 3 – Integration Architecture

Chapter 4 – Database Administration

Chapter 5 – Performance, Monitoring and Tuning

You'll find them here: http://msdn.microsoft.com/en-us/library/hh147624.aspx

It's great to see these documents now published. Enjoy!