July 2009 - Posts

Today I started reading my new book but I also wanted to find out a bit more about Hyper V, just to do something else. Well it is quite simple: It is the new virtualization technique used in Windows 2008 Server R2. The cool thing (in my view) is that it will use the physical server hardware in a much better and more efficient way. Also, it enables hosting Linux in a Windows Server Centre (Golem?).

Well in the course of looking for information about it I found out that Microsoft has a whole series of webcasts about Windows Server 2008 called “24 hours of Windows Server 2008”. Webcasts are a personal favourite of mine as I was raised by the TV and find that pictures+sound is a great way of learning new things (being spoon-fed). I do not think I need to watch them all but some are mandatory, like the ones about IIS 7.

So, the SQL-thing. As you know I do not talk to SQL server much these days but today I was once again forced to as my colleague wanted to know if there was any good way of concatenating row values, i. e.

CategoryId  ProductName                              
----------- ---------------------------------------- 
1           Chai
1           Chang
2           Coffee
CategoryId  Products                              
----------- ---------------------------------------- 
1           Chai, Chang
2           Coffee

The answer was “No” because there isn’t any function in T-SQL to do this. However I found a really innovative use of FOR XML on this page:

SELECT p1.CategoryId,
          ( SELECT ProductName + ',' 
            FROM Northwind.dbo.Products p2
             WHERE p2.CategoryId = p1.CategoryId
            ORDER BY ProductName
             FOR XML PATH('') 
           )    AS Products
      FROM Northwind.dbo.Products p1
     BY CategoryId ;

The really interesting part is the use of FOR XML PATH. It actually works!!! This has been a problem for a long time. I have never really looked into it until now but it still feels really good to find a nice solution. Maybe me and SQL server might start talking again. Baby steps…

I could do a really lame joke like “Azure, are you sure”, but I won’t.

So I have studied this technology from Microsoft on and off for about a week now and I can see the blue light shining. I understand what it might bring and how I can implement it. Do you want to as well? I thought so. I have compiled a list (there I go with the lists again) of what I think is the bare minimum. What you as a developer and/or a technology specialist need to read and do to understand what it is.

So here it is:

  1. Watch this clip from PDC08. John Shewchuk and Dennis Pilarinos presents a “Lap around the Azure Services Platform”. Very basic and highly informative. It is also 72 minutes long (!) but the last quarter or so are just Q and A.
  2. Read this document by David Chapell. It outlines Azure and its different services in a way that answers the inevitable question “What is it good for and why should we use it?”. Note that the document is from October 2008, but news since then are mostly add-ons.
  3. Download and install the July 2009 CTP tools for visual studio and ditto Azure SDK.
  4. Run through this walkthrough to get familiar with the tools.
  5. Unpack the samples. Information about the samples can be found here.
  6. Run through this walkthrough to really start using the different services.
  7. Start looking at the other samples. (Optional)

Now those of you that are already familiar with Azure and it’s different services might point out that I do not have “Register for an account” in my list. Well, you would be right, but you do not need an account to run the samples nor to understand Azure as a concept and technology. If you really want to, visit the Azure homepage at www.azure.com and register. This is also a very good resource for information of course.

Lastly there is the question of price and some time ago Microsoft published this. I have no take on it but you might.

Now my wonderful WCF-book has arrived. Really looking forward to cracking it open.

Not the catchiest of titles I admit but I am trying to be clear and distinct for google and possible feedreaders. Another title might be to quote a Swedish progressive rock song called Titanic (1977): "It started as a shudder on the lower deck", because that was in many senses true today. In short here is what happened:

Colleague: "Hmmm, I seem to be unable to start an installation of BizTalk Server 2009 on one of our production servers."

Me: "You need to start MSTSC with the /console parameter."

…cut to hours later…

Me: "Wow you actually cannot install BizTalk 2009 on a Windows 2008 machine using MSTSC from a Windows 2003 Server!"

The implications of this are, almong others, that installations that requires elevated rights on a Windows 2008 Server is impossible to preform remote from a Windows 2003 Server.

In order to install BizTalk Server on a remote machine using MSTSC you need to start it using the console parameter and up untill Win2008 this worked fine. Now it gets complicated. Win2008 does not have the concept of console in the terminal services arcitecture according to this article. Instead you start MSTSC using the admin parameter.
This makes sense since Win2008 uses elevated rights. In fact it is almost the same as console. However you need to run MSTSC version 6.1 (or actually 6.0.6001.18000, guess they rounded up) and now the issue arise.
The lates version of MSTSC for Win2003 is 6.0 (or actually 6.0.6000.16459) for Win2003 and it does not support the admin parameter and no release that supports the admin parameter has been scheduled accordning the Terminal Services team blog.
The comments on the post tell me I am not alone in this problem. The discussion is a bit heated to say the least ("I think that class-action suit is needed") and has lasted up until the 25th of June this year. Most people seem to use Win2003 on a jump server that people log in to and then connect to Win 2008 servers. This scenario makes it impossible to install BizTalk.

In short, to connect as admin to a server using Windows 2008, you need to use XP SP3, Vista with SP1 or higher or Windows 2008 (R2 will work as well).

Really, as of writing this post there is no real solution to the problem. Some guy gave a tip saying to use the MSTSC DDLs from the XP version and simply copy them to the Win2003 server. I just do not see that happening at a server center with 100+ servers. Our solution was to do yet another jump and use a Win 2008 server as the next jump server and start MSTSC 6.1.

If you are using Windows XP SP3, Vista or Windows 2008, this is not an issue since they run MSTSC version 6.1. If you need to download it you can either use Windows Update or get the XP version here. The Windows 2003 version can be found here, together with information about the release. If you run Vista or Windows 2008 version 6.1 is installed.

--- Later addition ---

Commenter "Niklas" suggested that a possible solution might be to first log on to the Windows 2008 server and then connect from that server onto itself (connect to localhost) using the local MSTSC with the /admin switch. At the present time I do not have access to enough servers to test this, however, to coin a phrase: It's crazy! It's crazy enough to work.

At the moment I am focused on learning more about Azure. A post on my findings will be published later.

I found something interesting about the licensing model for BizTalk 2009. It is called the "Runtime Edition". This takes me back to when I as a young developer made an application using Access 2000 *winces*. In order to distribute the application we had to make sure the end user either had Access 2000 installed or we distributed the Access Runtime.

Well, it seems the nice people at the Connected Systems Division have had a moment of enlightenment, since we now have access to a BizTalk Server Runtime License. Now there is a reason why I use "a moment", because that is all the attention it got! I have had a hard time finding any other blog posts on the subject. The original post refers to the standard BizTalk Server Editions page on the Microsoft site, which has no mention of the runtime license… Now I am in no way a man of conspiracies but this is strange…

I hope that this does not mean this form of license won't be available, because it is a really good idea.

I short it means that an ISV can use BizTalk Server within their product and, as BizTalk is not only a good product, it is also my daily bread. The more BizTalk is used, the more bread. Also an ISV can develop a good product and just add in BizTalk functionality instead of wasting hours on building things that BizTalk will be much better at no matter what.

Right now I can name two large projects within my company that has asked for BizTalk functionality for their respective products but shuns at the price. Hopefully the Runtime Edition will be competitive.

Later edit 2009-07-29

It seems that I am not as well connected as I need to be. The day after I published this post, Thiago Almeida posted on the same subject and apperently this was released at the Microsoft World Wide Partner Conference in early July. So it is official, not just web site official.

Now get out there, develop and then call on me or another BizTalk specialist on how to make that wonderful product a port of your solution.

SQL-Server and I has had a bit of a fallout. I don't talk to it and it doesn't talk to me. A shame really since we used to be very close back in 2001. Today we once again stood face to face. I said: "Oh, you look good. You have changed, and I like it. It looks nice on you." The reason for our meeting was that a colleague of mine asked a very straightforward question today: "Is there any T-SQL function for calculating the median value?". The short answer is: "No". The longer answer is "No, but there really should be should it not? Why is that?".

Some discourse ensued and consensus was that in order to calculate the median the data has to be iterated in not only a read-only forward manor, like for calculating the mean and therefore median has been excluded from the otherwise extensive list of functions available in T-SQL. Also there is the point of a median for all the results in the table or per grouping of some sort.

This is in no way a new problem and Google turned up these lines of code:

SELECT Identity(int, 1,1) AS Id, InvoiceTotal
INTO #Temp
FROM Orders
ORDER BY InvoiceTotal

SELECT @Median = InvoiceTotal FROM #Temp WHERE Id = ((SELECT Count(*) FROM #Temp) /2)


RETURN @Median

(Thanks to alias BobBarker)

This seems to be a simple and understandable solution. The problem is that this does not actually solve the problem as it only works for lists with even number of rows and that won't do.

Itzik Ben-Gan solves the problem beautifully though in this article. You simply make use of TOP and percent:

(SELECT TOP 50 PERCENT Value FROM dbo.VOrders ORDER BY Value) AS H1)
) / 2 AS Median;

Now if you have access to SQL server 2005 or 2008 you can use an even nicer solution, making use of such things as PARTITION and Common Table Expressions, but by then we remembered why we do not talk to each other anymore (SQL server and me) and I hit Ctrl+F4.

There is a nice code snippet that works just great though and maybe someday I will make use of it. Until then "we'll always have Paris".

This morning I felt like compiling a list of some kind. As a developer I tend to like lists and compiling.

The list title was: "Things released, or announced, by Microsoft while I was away and I need to learn (TODO)" (the working title was even longer actually). Here it is:

  • Windows 7
  • Windows 2008 and Windows 2008 R2
  • BizTalk 2009
  • SQL Server 2008 and IIS 7
  • Hyper V
  • WCF (I know but I don't know it)
  • Azure
  • Dublin
  • ESB Toolkit
  • Visual Studio 2008 (and 2010 beta)
  • VSTS 2008 (and 2010)
  • Framework 3.5 (and talk about 4.0)
  • Oslo

The good folks at Microsoft can surely fork 'em out! I think I will start with … … Well some guys I trust tells me that WCF is necessary bread and butter and Azure is the cool stuff so off I go.

Nice middle management people at my place of work made it possible for some of my colleagues to become MSTS for WCF (my face is green with envy I can assure you). Johan Hedberg (the head master of my colleagues' strife) said that this is the book to read if I want to learn WCF.

As usual Microsoft Press has seen to it that it is completely impossible to remember the title of any book. It is much simpler to just memorize the ISBN13 number.

New from Microsoft Press, out on Amazon: 9780735625655!

I often find myself accessing the GAC or the system-catalog. One way of doing this is to navigate using the windows explorer, and another way is to use a shortcut.

Another not so obvious and much faster way is to use the "Run"-option from the start menu (or simply windows key + R) and type "assembly" to open the local GAC or "system32" to open the systems catalog.

I am sure there are others for us to find.

Well I am certainly no fan of Vista as is, and today's little problem does not help.

I got this strange error when I tried to start a virtual machine: "…can't be started because it is being used by another program, or marked as read-only".

As you would expect I was not running another instance of Virtual PC, nor was the file marked as read-only. The problem was that Virtual PC has to be run as administrator. I knew this; however the error message did not exactly point me in the right direction so to speak.

This is my first blog post ever. There will be more.

I intend to use this blog as my own diary and information repository on my quest to "get back in the game". I have been away, trying to be a parent, for 8 months; which in internet time is like 5 years. So it's time for my reboot.

What have I missed? What is new? What is interesting? What must I know to be an above average consultant during fall and winter 2009?

Maybe you are like me and maybe this can be an interesting read.