Tuesday, October 30, 2007

Moving SSAS 2005 database to another drive

I just got asked how to move a SSAS 2005 database from one drive to another. The default data folder is the C: drive when you install SQL 2005. Usually, the data drive that system admins assign is the D: , F: , etc drive.
So how do you move a SSAS 2005 database? Well, apparently you can't move individual databases, you have to move the entire data folder to another drive. You also have to change the server property DataDir to the new location.
The steps are outlined here.
It would have been nice to allow moving individual databases like we do in regular SQL with detach/attach or restore to a new location.

Monday, October 22, 2007

Books to Read: an update

Update on books to read:
1. T-SQL 2000 - Itzik Ben Gan
Re-read 3 chapters. Downloaded the SQL scripts in the book from the publisher's website. I did not know that they existed. That will make a good reference.

3. Fast Track to MDX - Mosha
Almost done. Need to finish the last chapter.

8. SQL Server 2005 Analysis Services Step by Step - Reed
Good read. Read most of the book and found it very useful in building cubes in 2005.

I will concentrate on finishing the above books and move on to the other ones.

CTE in SQL 2005

Common Table Expressions in SQL 2005 rule! One of the best uses of CTE is to do recursive queries. The syntax for it is as follows:

WITH myCTE (id, name, desc) AS

(

select id, name, desc

from table

you can reference the CTE here

)

select * from myCTE

The concept is similar to using derived tables in the way that your query can reference the CTE or derived table. The difference is that in a derived table you can only reference it after the derived table query has run. In a CTE, you can reference it while executing your query. And this makes it easy to build recursive queries.