Today’s day in SQL, volume IV

(This is a repost from one of my previous attempts at being interesting)

 

Quoth the Books Online:

Remarks
ISNUMERIC returns 1 when the input expression evaluates to a valid integer, floating point number, money or decimal type; otherwise it returns 0. A return value of 1 guarantees that expression can be converted to one of these numeric types.

[ emphasis mine ]

Now try this in Query Analyzer:

Select IsNumeric(‘.’)

…which returns 1. So, for bonus points, what does this do?

Select Cast(‘.’ As Numeric)

…an error. Wonderful. Lies, lies, lies. This function could be in the Bush administration!

 

Now for the fun part: this blog entry got 1, yes one comment:

As the good book(s online) says:

ISNUMERIC returns 1 when the input expression evaluates to a valid integer, floating point number, money or decimal type; otherwise it returns 0. A return value of 1 guarantees that expression can be converted to one of these numeric types.

And now try:
Select Cast(‘.’ As money)

Typical dutch unfounded complaining 😉

Insane unfounded and ignorant xenophobia aside (oh, wait, let me throw in a 😉 there)… this comment, which I only discovered a few minutes ago, has me scratching my head. If I had any left, it might even to cause me to pull out my hair. So, you quote the exact same passage I did, then quote my showing how it lies, and then call that unfounded complaining.

You know what? Let’s move on. This way lies madness.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: