Mladen Prajdić Blog

Blog about stuff and things and stuff. Mostly about SQL server and .Net

Annoying SQL Server "bug feature"

here's a select. don't run it just look at it and think what it returns:

SELECT 123.654, 123d6, 123e4, '123'e4

ok now run it.

the results are:

(No column name) d6 (No column name) e4
123.654 123 1230000 123

 

I lost 2 hours of debugging this little annoying as hell "feature" for 123d6 value.

i mean come on... where is the freakin' logic here???

why not just say error in parsing or something??

Legacy Comments


Alexander Gladchenko
2006-11-03
re: Annoying SQL Server "bug feature"
select 1from sysobjects;
SELECT top 1a from (select 1 a) a;
SELECT 123'col2';

Alexander Gladchenko
2006-11-03
re: Annoying SQL Server "bug feature"
select'4'bag;

Mladen
2006-11-03
re: Annoying SQL Server "bug feature"
isn't that annoying as hell? at least to me it is...

i really wish that would be syntacticaly wrong.

Mark Buckle
2006-11-06
re: Annoying SQL Server "bug feature"
If you'd ever written a yacc/lex parser, especially one for SQL, you'd be familiar with these kind of 'features'. In short, white-space isn't the only thing that can separate grammatical elements, if those elements can be 'lexed' separately................

Johan
2006-11-07
re: Annoying SQL Server "bug feature"
In my home language, we have a proverb stating that a knowledgable person needs only half a word. Well, computers are not knowledgable (yet) so, give them a "full" word. ;-D