# Saturday, July 23, 2005

Just a quick post to say I've moved the blog to a sub-folder because upgrading every virtual directory under the root every time I upgrade dasBlog is a pain.

You shouldn't notice anything different except you have now come through to /blog instead of the root. I have redirectors on the site so any old permalinks should still point to the correct place. This goes for my feeds as well but some readers don't understand redirects and you'll have to update.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, July 23, 2005 4:41:27 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, July 17, 2005

If you are developing Reporting Services extension assemblies that require <appSettings> elements in application configuration file (e.g. <add key="SqlConnectionString" value="Integrated Security=SSPI;Data Source=(local);" />) then you will need to modify a couple of files:

  • To design reports successfully, add the configuration to the VisualStudio app.config file
    C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe.config
  • To deploy successfully, add the configuration to the ReportServer web.config file
    C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\web.config
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, July 17, 2005 2:30:43 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, July 09, 2005

Microsoft Patterns and Practises have finally released the tool they use to automatically generate the resx resource files in their Enterprise Library. My thoughts on the library itself are covered elsewhere in this blog but this tool is fantastic. It's a real time saver because each string only requires a single line in the strings file and no angle brackets which is no worse than typing into your source file. Grab the zip file (you will need to join the workspace to download), install and read the docs.

On the subject of tools, don't miss Scott Hanselman's 2005 Ultimate Developer and Power Users Tool List.

Now playing: Koan Bremner - CO-010-20050703 - CrossOver Session Ten

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, July 09, 2005 12:42:12 PM (GMT Daylight Time, UTC+01:00)  #    Comments [3] Trackback
# Tuesday, June 21, 2005
Back at the beginning of the year I talked about optimising user/group hierarchies in SQL but missed off one important part of the puzzle - how to delete the memberships. Well Vikram has put some thought towards the problem and come up with a solution.
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, June 21, 2005 5:18:12 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Monday, June 13, 2005

Just a quick post to say Happy Birthday to my blog. My first post was a year ago yesterday and was pretty inconsequential but going to Tech-Ed shortly after brought some technical content online. My most Googled posts have to be "Uniqueidentifiers as Primary Key Columns" and "How to trash your system when writing installers". The geekiest toy was "Geekman" and the hardest post to write was "Coder Block". I used to post nearly every day but realised I couldn't keep up the pace and now it's more like once or twice a week at the weekend. Long may it continue.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Monday, June 13, 2005 7:09:37 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, June 05, 2005

Just for fun and to kill some time, here are the flags of the visitors to this website last week. They are ordered by number of hits from that country. I had no idea there was such a diverse collection.

[Apr 2008 edit: sorry, there used to be a picture here but it got to be the top hit in Google image search for a very common term and I can't support the amount of bandwith needed to service all the queries.]

 

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, June 05, 2005 12:28:41 PM (GMT Daylight Time, UTC+01:00)  #    Comments [3] Trackback
What Video Game Character Are You? I am Pacman.I am Pacman.
I am an aggressive sort of personality, out to get what I can, when I can. I prefer to avoid confrontation, but sometimes when it's called for, I can be a powerful character. I tend to be afflicted with munchies constantly. What Video Game Character Are You?
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, June 05, 2005 10:47:14 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, June 04, 2005

It's been a while since I posted last due to our current work schedule. It's hard work preparing a new product version when that release is due to go to a customer before it's GA'd.

Anyway, in this post about "Uniqueidentifiers as primary key columns" I talked about some of the benefits to ditching the traditional IDENTITY columns. I did point out that their use in data warehouse applications is questionable as key sizes become important when dealing with huge amounts of data. Herein lies the problem - we have an application that uses uniqueidentifiers wherever possible but dimension tables still use integer keys. No problem so far but we have recently tried to implement parent-child dimensions within Analysis Services and our folder structure is using uniqueidentifiers as keys.

As you may know, Analysis Server uses a simple arrangement for parent-child dimensions where each member has a key column and a parent key column as per the adjacency list model. To implement this, lets assume two tables Office and Folder where Office is a dimension and Folder is a hierarchy into which we place each office. The two tables look like:

create table Folder (
    folder_id int not null primary key,
    parent_id int not null,
    name nvarchar(50) not null
)

create table Office (
    office_id int not null primary key,
    folder_id int not null,
    name nvarchar(50) not null
)

There is a foreign key between folder_id in the two tables to tie them together. Note, I've used integer primary keys here so creating a parent-child dimension is easy as follows:

create view OfficeTree
as
    select folder_id + (select max(office_id) from Office) as item_id,
           parent_id + (select max(office_id) from Office) as parent_id,
           name
    from Folder
    union all
    select office_id,
           folder_id + (select max(office_id) from Office), 
           name
    from Office

Note, that the Folder keys must be offset to ensure they don't clash with the Office keys. Now if we try and change the folder_id and parent_id fields in Folder to uniqueidentifiers we end up with a problem - the data types are not compatible when creating the view OfficeTree and you get the message "Operand type clash: uniqueidentifier is incompatible with int".

The solution to this problem is of course to either go back to using ints somehow. I was about ready to remove the uniqueidentifiers when Koan Bremner came up with the following solution. The trick is to realize that the references between the two tables are only required when processing the dimension and Analysis Server doesn't care if the IDs change between cycles just as long as the keys joined to fact tables remain constant. So we still need to add an integer key column to the Folder table as below:

create table Folder (
    folder_id uniqueidentifier not null primary key,
    parent_id uniqueidentifier not null,
    alt_id int null,
    name nvarchar(50) not null
)

We allow the column to be null because the keys are only required before we process the dimension and allowing NULLs ensures easy inserts in a replicated environment. To update the column before processing requires a little magic (again from Koan).

declare @counter int
select @counter = isnull(max(alt_id), 0)
from Folder

update Folder
set @counter = alt_id = @counter + 1 -- Ed: Typo fixed (see comments).
where alt_id is null
option (maxdop 1)

The maxdop option ensures a sequential update to the column which forces an incrementing value. Now we can rewrite the view to use the new field. Note that we have to join back to Folder in order to resolve the parent_id field.

create view OfficeTree
as
    select f1.alt_id + (select max(office_id) from Office) as item_id,
           f2.alt_id + (select max(office_id) from Office) as parent_id,
           f1.name
    from Folder f1
    left join Folder f2 on f2.folder_id = f1.parent_id
    union all
    select o1.office_id, 
           f2.alt_id + (select max(office_id) from Office), 
           o1.name
    from Office o1
    left join Folder f2 on f2.folder_id = o1.folder_id
 

 

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, June 04, 2005 1:37:31 PM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback
# Tuesday, May 10, 2005

We have a position open at Exony for a test developer (what Microsoft calls a Software Design Engineer in Test or SDE/T). For some reason most testers in the UK are what I would call QA engineers and do not consider writing code part of the job specification so if you fancy working for a young dynamic company that:

  • Scores highly on the Joel Test
  • Provides you with your own laptop and pays your mobile phone charges
  • Allows for plenty of home work (some office time is a requirement though)
  • Practises agile development with Scrum
  • Uses the latest products and technologies

You should send me a copy of your CV/resume to the e-mail address at the top of this page. You should have the following qualities to be eligible:

  • Ability to work in the United Kingdom (Newbury, Berkshire to be exact)
  • Experience with XUnit (NUnit/JUnit) frameworks
  • Ability to code C# in your sleep
  • Strong troubleshooting, debugging, and analysis skills
  • Good verbal and written communications skills
  • Experience with SQL Server, Windows 2000/2003, ASP.NET and web services
  • A passion for software testing and quality

You will work as part of the development team to understand customer requirements, develop the appropriate test tools, processes and code, identify and analyse bugs, raise quality and drive the product towards shipping.

No calls from recruiters please. I have a number that I am already dealing with and don't have room in my schedule for more.

[Edit: This position has been filled. Thank you to everyone that applied. I will have more positions posted in the near future.]

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, May 10, 2005 9:35:32 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, May 01, 2005

It's May Day Bank Holiday Weekend so I was going to try and stay away from the blog but after a testing afternoon with the new Team System Beta I thought I'd better share.

Firstly the install. I created a new Virtual PC image of Win2k3 SP1 to install the Team Foundation Server on. What the install guide doesn't tell you is that if you turn a server into a domain controller after installing Internet Services then the web won't work. You only find this out after installing SharePoint Services and following the troubleshooting guide when things don't work. After reinstalling SharePoint, Reporting Services and Internet Services things looked better and the Team Foundation install worked first time which was much better than my Beta 1 experience. However, after install, Analysis Services and Internet Services are hammering the CPU for no reason that I can determine. Installing the Visual Studio client was just as frustrating as the Beta 1 uninstall doesn’t clean up too well. After a couple of failed attempts I found this tool to clean up before installing.

Connection to the Foundation Server worked first time but failed to create a portfolio project complaining that the methodology could not be found. I haven't been able to get any further with this. The non-team bits do pretty much exactly what it says on the tin although the Intellisense is a little aggressive. The performance stuff also works well but the testing tools crashed the development environment every time I tried to run a test. This maybe due to the installation difficulties but I can't tell. Time to put it all back in the box and wait for the release I think.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, May 01, 2005 8:03:28 PM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback
# Sunday, April 24, 2005

These guys are driving me nuts so I'm afraid I've had to protect my site by forcing you to login before changing anything. If you feel you need access then let me know and I'll give you a password.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, April 24, 2005 6:55:19 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, April 23, 2005
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, April 23, 2005 1:12:10 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback