# Saturday, August 28, 2004

A Short History of Nearly EverythingThe incomparable Bill Bryson travels through time and space to introduce us to the world, the universe and everything. -- Amazon

I have never read anything by Bill Bryson before as I'm not really into his usual genre of travel writing but I was given this by a friend. In short, it's a great book - I was hooked by the end of the introduction where he describes his early experiences with a textbook containing a cut-away of the earth illustrating the earth's interior. He asks "How did they know that?". A question which resonates from my own school years, where teachers would often avoid the question or provide some unconvincing answer. The book promised to provide some real answers.

As for the "nearly everything" description, he is not wrong. The book covers some five hundred years of scientific history and touches on subjects of cosmology, maths, physics, chemistry, geology, vulcanolgy and biology. We learn how to build a universe, how to measure the size of the earth, what the inside of an atom is like, how mountains are created (and destroyed), the precarious nature of life and how we came to be.

The whole text is littered with little tidbits of curiosity; like the person who really discovered something as opposed to the person given the credit and the back story to each scientific breakthrough. He must have expended a huge amount of energy to get all this in. All of this is told in a witty style that makes compelling reading.

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, August 28, 2004 2:57:01 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback

Microsoft have adjusted their goals and dates for Windows Longhorn. Primarily by relegating WinFS to an add-on that will be shipped later; but also committing to ship Indigo and Avalon on XP and Windows 2003 systems. There is no mention of the user experience (Aero) though. More details can be found here:

[Edit: Jim Allchin, the Group Vice President for Platforms at Microsoft, is on video at Channel 9 explaining the details.]

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, August 28, 2004 11:49:10 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
You can sign up for beta-place access if you have found any bugs in SQL Server 2005. Details are at http://msdn.microsoft.com/sql/bugs/.
by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, August 28, 2004 11:06:24 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback

Aaron Bertrand has started collecting content for a SQL Server 2005 FAQ. There is some useful stuff in there but needs more content so here you go Aaron.

Why do new query windows use the master database?

This behaviour is different from Query Analyzer and can often cause you to execute scripts in the wrong database. This is especially unproductive as there is no select multiple in Object Explorer to clean up the damage quickly.

In actual fact the old Query Analyzer behaviour is still there, just under a different button. You need to select New Query with Current Connection  which is just to the left of the database selection list in the SQL Editor tool bar. Alternatively, CTRL-Q (Standard Keyboard Scheme) or CTRL-N (SQL Server 2000 Scheme) will do the same.

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, August 28, 2004 10:59:41 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, August 24, 2004

Your natural dimension primary key maybe too large to use in a data-mart with hundreds of millions of rows so you might need to create a smaller alternate key. Sometimes it's not always best to use IDENTITY columns.

Imagine the case where you are importing data from an external system. The usual method to add the correct foreign keys is to either create a lookup (in DTS) which can be very slow, or try and join the imported data to your dimension table and extract the dimension key (which is also pretty slow). I've used a date lookup here as an example (time of day is not used):

update dbo.ImportedData
set DateID = d.DateID
from dbo.ImportedData t join dbo.Dates d
    on d.Date = cast(floor(cast(t.Date as float)) as smalldatetime)

For dimensions like this it maybe much more efficient to create keys using a calculation performed on the common fields. For example, the number of days since a point in time:

update dbo.ImportedData
set DateID = datediff(day, '2000-01-01', Date)
from dbo.ImportedData

This avoids any sort of join and, in fact, could be performed on the data stream as it is loaded into the database. Also, if you use a smallint for the key then you get a 50% saving from the original smalldatetime type and are still able to use dates past 2175.

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, August 24, 2004 5:36:44 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback

OK, it crashes a bit because it's beta software. But at least it has this:

Auto Recovery Dialog

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, August 24, 2004 4:39:06 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback

In order to optimise queries fully in previous versions of SQL Server you might have had to create a covering index by adding all the select and where columns to the index definition. This enabled an index to completely satisfy a query and avoid a bookmark lookup on the underlying table.

In Yukon there is a new keyword on the CREATE INDEX syntax - INCLUDE. This allows you to store additional non-key columns with the index but avoid the cost of them being in the actual non-leaf index structures. So for example:

create index IX_Dates_Date on dbo.Dates(Date)
include (
    Year, Month, Day,
    MonthName, DayOfWeekName, WeekOfYear
)

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, August 24, 2004 1:54:09 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
# Monday, August 23, 2004

They only seem to care because we, as software developers, make them play the requirements game. In reality, the only thing that that matters is how the final product matches up to their expectations. The big problem is that you can't capture them in a document to use as the blueprint for development. There are some things you can to ensure your customer is happy with the end result:

  1. Write a short "Vision" document describing the key features to get everyone on the same page early on
  2. Program by feature to produce functionality early, don't spend too much time on infrastructure
  3. When you've completed a feature, show it to the customer and get feedback
  4. Allow the customer to change their minds

These points will only work when both you and the customer share the project risk; either with fixed rates/variable time or fixed time/variable functionality.

If it's a fixed price/fixed functionality contract then you'd better start writing those requirements...

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Monday, August 23, 2004 7:06:50 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, August 18, 2004
There is an excellent article in this months MSDN Magazine entitled "Streamline Your Database Setup Process with a Custom Installer". We do something similar in our own product, but nowhere near as complete as this. It covers version checking, upgrades, patches, extended stored procedures and bulk loading of data.
by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Wednesday, August 18, 2004 1:12:20 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, August 17, 2004

Ralph Kimball has written an excellent series of articles about data warehouse theory and practise. They range from Data Warehouse Fundamentals through Data Warehouse Architecture and Modelling to Data Staging and Data Quality.

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, August 17, 2004 11:40:11 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, August 15, 2004

I've just noticed a very nice side affect from having the refactoring functionality in VS2005. When you rename something using the property window, it automatically updates all the references. So you know what has just happened this appears in the refactor window:

Rename
d:\work\dataentry\form1.designer.cs(3,16): updated definition
d:\work\dataentry\form1.cs(14,16): updated definition
d:\work\dataentry\form1.cs(16,10): updated reference
D:\Work\DataEntry\Program.cs(21,24): updated reference

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, August 15, 2004 12:23:16 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, August 14, 2004

When I'm in front of my computer all day I usually listen to music. Since getting broadband I've discovered the Radio 1 On Demand Player. It's a great way to catch all the specialist shows they do in the evenings plus my favourite, The Essential Mix - recorded live in a club in the wee small hours of Sunday morning.

Radio 1 have recently changed their line up and I'm really enjoying one of the new shows: Annie Mac who plays a pretty cool mix of house, hip hop, bass and beats.

by This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, August 14, 2004 2:13:05 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback