• As usual the simple ideas are the best. Good article.

    From the forum comments I notice that the different versions of SQL give different results thereby illustrating that the SQL Server Query Optimiser does get better through time.

    When I started using SQL Server (back in the 6.5 days) there was a trick to put a completely superfluous wide ranging BETWEEN condition in a WHERE clause to force an index seek. From SQL2005 that became completely unnecessary and in some cases detrimental.

    It is always worth re-visiting what we learn to see if they continue to apply as technology evolves.

    It will probably seem bizarre to today's programmers but once upon a time garbage collection was seen as a ludicrous waste of resource and languages depending on it would never catch on. We were told always to manage the life cycle of our objects ourselves. Always explicitly destroy what you create. These days we are taught not to try and 2nd guess garbage collection until we really know what we are doing.