SQL Server – Nullable column comparisons needed?

It is very common to need to compare the values in two nullable columns, without changing the ansi nulls setting. For example, it is common to have to write:

WHERE (a.SomeColumn IS NULL AND b.SomeColumn IS NULL) OR (a.SomeColumn = b.SomeColumn)

Given how common this is (particularly for some forms of optimistic concurrency checks that aren’t based on rowversions), there should be a simple way to express the intent. I also presume the optimizer could also potentially take advantage of knowing the real intent of the statement.


A new operator is needed, to enable syntax like:


WHERE a.SomeColumn MATCHES b.SomeColumn

It could potentially be something like:
==
EQUALS
IS_EQUIVALENT_TO
or perhaps expressed in a negative form like:
DIFFERS_FROM


Perhaps we could even make a play on the “int?” used by .net generics and make it:

WHERE a.SomeColumn ?= b.SomeColumn

If you think this is needed, this is where you vote: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=307476

Bouquet for Vista

Everyone seems to love knocking Windows Vista. However, I regularly find things about the operating system that just impress me. Today I changed my hard drive to a new one, and yes it made me reactivate the system *but* I was trying to think of what sort of utility I’d need to extend my 100G drive out to use all the 200G of space. To my surprise, I right-clicked the partition and it offered “Extend Volume” and even though it was a simple volume, it happily just extended it out for me. That was a pleasant surprise.

QANTAS: Last week’s score – Electrical staff needed?

Clearly, a lot of people have been following my QANTAS postings lately. This week, I’ve had many that have asked me how the flights went this week. The daytime flight from Sydney to Canberra on Wednesday was fine. The flight home from Canberra to Melbourne on Wednesday night was basically fine. I still don’t understand the “priority” baggage handling as my bag was the last one off the whole plane but at least the flight was on time, was fairly pleasant and my bag was at the other end.


So, did I have a good set of flights for the week? Sadly, the flight from Melbourne to Sydney on Monday night let the side down. We boarded late. It was explained that the incoming aircraft was late. I hear that all the time and presume it’s airline-speak for “we don’t have enough room for error during the day so as soon as anything goes wrong, our night flights are typically late”. Then we sat and waited. After a while we were told we were waiting on a passenger from Hobart. After another delay we were told we were no longer waiting on the Hobart guy as he’d got lost in the airport. However, now we were told that our bags hadn’t quite finished getting loaded anyway and the captain made a joke about us “not wanting to go without those”. Then he said they had been loaded a few minutes back. Once again, we sat for a while, wondering what was going on. If our bags were now on and we’d forgone the Hobart guy, why hadn’t we left. That’s when the all-to-familiar message came:


The captain said “well, we’ve got one engine started but there seems to be a small electrical problem with the other one”. “We’ll have to get it looked at and hopefully we won’t be too long”.


So I was sitting there thinking that it was now three flights in a row where the aircraft I was on had electrical problems. Do QANTAS need new electrical staff or is there a problem with funding the current staff to do their jobs?


Ah well, let’s see how this week goes…

Ajax Control Extender for CardSpace

Another bright colleague at Readify, Daniel Bartholomew has just published an Ajax control extender to enable CardSpace authentication. Daniel has been working with CardSpace for quite a while now and this should be a worthwhile addition to the Ajax Control Toolkit.


It enables you to easily add CardSpace authentication to your web site. Daniel has just posted it up to CodePlex. You can find it here: http://www.codeplex.com/CardSpaceAjax


 

SyncLink – LINQ extensions for data binding

Readify colleague Paul Stovell has been working on an extension to LINQ for a while. He’s finally announced it. Paul describes it as “SyncLINQ is a set of extensions to LINQ that enable data binding over LINQ queries. SyncLINQ alters LINQ queries so that they return INotifyCollectionChanged collections, meaning that when the sources are updated, the result of the LINQ query is also updated.”.


It’s interesting work and Paul has provided a 7 minute video to show it in action as well.

Movember, Readify Mo Madness and Men’s Health

My Readify colleague Philip Beadle has been taking a great lead amongst our staff in promoting Movember. He put together a team last year and I didn’t get to take part. I wish I had been around to do so. I’m not going to miss it this year. I’ve joined “Readify Mo Madness”.


Movember highlights men’s health during November. Participants grow a Mo and it’s a bunch of fun but there’s a very serious message. It’s a personal message for me as about 10 years ago, I had a period of serious depression. The loss of my father was a key trigger but there were many others. I had a period of about a month or so where I really wasn’t myself, managed to offend (apparently permanently) a number of people I’d known a long time and generally made a bit of a mess of things.


Most men don’t seek help for this. I’m glad I did. It’s way too common. Because depression doesn’t have an obvious physical symptom like other illnesses, others don’t seem to understand it. It still amazes me how people who’ve known you for, say, twenty years can’t realise that you just aren’t yourself when going through this. If you see behaviour that’s way out of character for someone you’ve known a long time, try to look beyond your immediate reaction and try to work out if they need help rather than passing shallow judgement. There seems to still be a stigma in the community about admitting that you’ve been through this. Given how common it actually is, that’s truly sad. Awareness of the problem is the first step.


The money raised by Movember is donated to the Prostate Cancer Foundation of Australia and to BeyondBlue – The National Depression Initiative. The funds will be used to create awareness, fund research and increase support networks for those men who suffer from prostate cancer and male depression.


Philip’s email to us also noted:


  • Depression affects 1 in 6 men…Most don’t seek help. Untreated depression is a leading risk factor for suicide.
  • Last year in Australia 18,700 men were diagnosed with prostate cancer and more than 2,900 died of prostate cancer – equivalent to the number of women who die from breast cancer annually.
  • Men are far less healthy than women. The average life expectancy of males is 5 years less than females.
To sponsor my Mo please go to http://www.movember.com/au/donate, enter my registration number which is 70880 and your credit card details. Or you can sponsor me by cheque made payable to the “Movember Foundation” clearly marking the donation as being for my Registration Number: 70880. Please mail cheques to: PO Box 292, Prahran VIC 3181. All donations over $2 are tax deductible.

QANTAS: The fun (not) continues

Another one for those that follow my travel postings: In a recent post, and a prior post, I noted some of the issues I’ve been having with QANTAS flights recently. In the latest one, I mentioned I was heading off to Singapore for the week last week and wasn’t looking forward to the QANTAS flights. Well, the photo below pretty much sums up the experience for the week.


Generator Dead 


Yes, that’s the engine of our plane opened up on the tarmac at Changi Airport late at night, after we should have been half way to Melbourne.


The flight over left a bit late but arrived early. I’m not sure if anyone at QANTAS read my comments about the customer service officers no longer coming down to find the Platinum members buried in ecomony to say hi (like they did until a few months back) but on the trip over, I had two of them come and say hi. That was an interesting change. The flight over would have been fine except I had intended to catch up some reading. Sadly, the overhead electrical systems in the entire section of the plane that I was in were not working. That means no reading lights, warning lights, etc. I asked a flight attendant about it and he told me that it was somehow also related to the infernal entertainment systems. Apart from that, the flight was reasonable, arrived early and my bags also arrived.


The flight back was another matter. We were meant to leave Changi at 7:45pm on Sunday. We ended up leaving just after 8pm, so I thought we were off to a reasonable start. The customer service officer also came down to say hi so it looks like that practice might have been reinstigated. At takeoff, there was a very large vibration, much moreso than other jumbos I’ve ever been on. I didn’t think too much of it as I’m always amazed that jumbos can take off at all. However, about half an hour into the flight, the captain came on the PA to tell us that we’d lost an electrical generator. He said we’re allowed to fly with one broken but flying with two broken wasn’t considered safe. The bad news was that we already had another one broken, so that made two now dead. We would have to return to Singapore. We flew around for about another half hour dumping fuel (as we were way over allowed landing weight) and then flew back to Singapore. So, an hour and a half after we left Singapore, we were back.


After a while sitting in the plane while the engineers made basic checks, the captain then apologised and said we’d all need to get off. The customer service folk said “good news, we’ve organised dinner for you”. So we all traipsed off through the airport up to the food court. It was all quite unpleasant. We stood in a queue for about 40 minutes. QANTAS had arranged for $25 vouchers for each of the passengers for dinner but only three of the restaurants in the food court could be used. While the restaurants did a better job than I could if 300 – 400 people dropped in for dinner at my place at 11pm at night, they struggled big-time. By the time we got to the front of the non-moving queue, the food had pretty much run out and the noodle place was doing the best it could, which wasn’t great. It’s no surprise that you can’t take dry noodles, dip them in boiling water for 20 to 30 seconds and then serve them without them tasting like sticky, uncooked noodles, which is what they were. They were completely ghastly. The voucher guys must have made a killing too because the noodles we had were priced at $8.60 and none of us could be bothered standing in the desert/cake/drink queue once we’d stood in the noodle queue for so long. I’ll bet QANTAS still got billed $25 per head.


Once we got back to the gate area and went through security/scanning again (we had been told to be back in an hour), we then sat and watched them trying to fix the generator, as per the picture above. The whole time we were there, I was thinking about it and realising that when the flight arrived in from London and had a few hours before we boarded, the generator that was already broken could have been fixed and we wouldn’t have been in that predicament. I’m sure QANTAS were just expecting to fly it home with the broken one and fix it at home base. In hindsight, the marginal cost that would have been incurred in having it fixed before we left must pale into insignificance with the costs that were then encountered. I can’t imagine what it cost for the load of fuel that we dumped, the extra terminal fees, the dinner costs for 315 people, etc. but I can imagine how hundreds of people then had their lives impacted by this decision and no-doubt, cost-cutting exercise.


So, our flight that was meant to get in at 4:45am ended up landing at 9:30am.


The seat preallocation system is still loopy. Even though I have “rear aisle” set up as a preference, I was allocated 49G, directly over-wing but at least aisle. I checked beforehand to make sure I wasn’t in a row behind a bulk-head row as I didn’t want to have another trip like the last one. Even though I’d done all that, when my boarding pass was scanned just prior to boarding, the staff told me “sorry but we had to move you to 48G to let a family of four sit together”. So, you guessed it, even though I did everything I could to avoid it, I ended up in the row behind a bulk-head row again, with all the issues with lack of foot space, etc. Even though I would have agreed to moving to let a family be together, it would have really been nice to have been asked if it was ok -> sigh <-


The other benefit of frequent flyer membership is meant to be preferential baggage treatment. Again, even though we went through the premium checkin in Changi and had first class tags on our bags, they came off the conveyor pretty much with the last of the bags from the flight. That of course maximises the time we got to spend in the quarantine queue. This also seems to be a regular occurrence now. It’s another aspect of the program that used to work ok until about six months ago. 


I’ve got 3 or 4 flights with QANTAS next week but they’re just domestic so hopefully less painful. However, they’re all at night so I’d place the odds of them leaving on time at near zero. I can’t wait.


I’ve got some more international flights with QANTAS coming up soon. I really hope I can report something positive.


 

Outstanding SQL Server Blog: Paul Randal

Since he has left the SQL Server group at Microsoft and joined his wife Kim Tripp at SQL Skills, Paul Randal has been becoming even more prolific with his blog posts. If you really want to learn a lot about how things like DBCC CHECKDB, DBCC IND, DBCC PAGE and SQL Server indexing, etc. really work, make sure you are subscribed to his blog. The content lately has been outstanding. Paul’s blog is here:


http://www.sqlskills.com/blogs/paul/

Book: The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich

Timothy Ferris’ new book The 4-Hour Workweek: Escape 9-5, Live Anywhere, and Join the New Rich contains some pretty solid (and again challenging) thinking for most of us.


Tim describes the DLP (delayed life plan) that most of us aspire to as ill-conceived. Rather than spending your whole life working to save for a retirement, which many never see or are no longer capable of enjoying, Tim argues that you should look to take mini-retirements constantly. Leaving it all for a later day is not sensible.


I’ve often heard descriptions of life that say that it’s not the destination that’s important, it’s the journey that matters. The older I get, the more I think that’s just so true. Any time you find yourself saying to one of your kids “Sorry, I can’t do xxx with you right now. I have to work. We’ll do it sometime soon.”, you are losing in life’s journey. The old Cats in the Cradle song by the late Jim Croce was so insightful and I’m sure struck a chord with so many in the world.


In the book, Tim argues that in future (or even now), real wealth needs to be assessed by including factors like available time. An investment banker on $500,000 USD per year but who is chained to his/her work is not rich, regardless of how the community may have perceived them. One day, the person hopes to be able to stop working and do the things that they should have done throughout their lives while they were physically capable of enjoying them.


Much of the book is based on trying to develop a working lifestyle that isn’t chained to any location and being able to experience the rest of the world first hand. Ironically, our industry is one that lends itself well to this style of work. The book also includes some great thoughts on learning to delegate (till it hurts and then beyond).


While I can’t say I agree with all of Tim’s premises in the book, it’s hard to imagine reading it and not learning a few solid lessons along the way.


Recommended!