Saturday, November 08, 2008

Of SQL ANSI operators and Outlook shortcuts

We recently migrated our application from SQL Server 2000 to SQL Server 2005.

Since this means that the *= and =* operators shall no longer work, we were asked by our onsite coordinator to search for occurrences of these operators in our code, replace them with LEFT OUTER JOIN and RIGHT OUTER JOIN respectively, and test the code.

We did so, and finding everything to work fine, I opened Outlook to fire a mail to my onsite coordinator. While typing,
We searched for occurrences of *= and =* in our code

I found that the word, 'and', became bold, like this.



"Huh?", I thought. "What's up?"

I deleted the text and typed it again, thinking I had pressed some key by mistake (though I was sure I hadn't). It occurred again!!

My heart began to flutter wildly. Had I discovered a hitherto unknown shortcut in Outlook? Yippee!!! I could impress my colleagues (who are heavy mouse users) with my speed using yet another keyboard shortcut!!! Woooooooooooo!!!

But I wanted to verify it first. Since I already knew that Outlook uses Word as its email editor, I opened up Word and typed in some sample text within *= and =*. If Word behaved the same way, then it was really a shortcut in Word to make text bold.

No.. it didn't!!

"Ok, it was not an inbuilt shortcut of Word, but atleast, is a useful shortcut within Outlook," I thought. "Yippee!! I can impress my colleagues, and enjoy the this-guy-seems-to-know-a-lot look on their faces when they see it for themselves!!"

But I decided to play safe. Calming myself down, I checked Google for links on the *= and =* as a shortcut. No relevant search results cropped up. Feeling a bit let down over losing a potential blog post :p, I persevered, but to no avail.

Sadly, I opened Gmail to check my mail (not sure what made me think of this one). I read a mail from a member of one of the discussion groups I am in, and he had placed some text within asterisks, like so:
*some text*

Realization hit me. It was the usual shortcut for making text bold!! SHEESH!!

(In case you didn't get it, you can make a text bold by keying in '*', then your text, and then '*' again (of course, without the quotation marks given here). This appears to be a way to represent bold text on email editors that can support only plain text.)

But I persevered on. If it really was a shortcut, then I believed it should work even if we typed it as
*= sometext *=

since I believed that Outlook identified the start and end of the text by the asterisks. But no, the text did not become bold. Strange!!



Even more strange was the fact that if I typed it in as
*=sometext*=

then it worked!!!



The only difference between this text and the text above it is that the space between *= and the text is missing here. Also missing is the space between the end of the text and *=. The space character seemed to play an important role.

On further tinkering, I finally understood that Outlook seems to insist that to make a text bold by using the asterisk key, the starting asterisk must not be followed by a space, nor should the ending asterisk be preceded by a space (I don't have any proof by way of any links for this, though). This can be understood by typing
* hi *

which will not make the text bold. In fact, keying in the asterisk and pressing the spacebar results in a bulleted list!!

SHEESH... its normal behaviour and I got carried away!! In fact, I even thought of a blog post about a new shortcut 'discovered'!!

"Hmm, there goes a blog post!!", I thought. Then my brain told me, "If conferences can be held over failure, then why not post this? It serves as a proof of your learning."

And so, this blog post.

Some notes:
1) Some other shortcuts I found in Outlook as a result of this experience:
a) Typing '*' and pressing a space results in a bulleted list with the black bullet (ya, that's what I call it!!)
b) Typing '>' and pressing a space results in a bulleted list with the right-hand pointing arrows.
(What are the names for these bullets, anyway?)

2) Also see this page for other shortcuts in Windows.

3) I know I should have told this first, but its not too late, I guess... I am using Outlook 2007.