• da-zero (9/27/2010)


    tommyh (9/27/2010)


    da-zero (9/27/2010)


    Good question, although I seem to remember that I've seen similar ones.

    But I don't think that considering scientific notation as numeric is stupid. 2e1 is just another way writing 20, so it is still a number.

    I think the reason why you can't immediately convert it to an int is because of how SQL Server handles the scientific notation. But I can't seem to find any references on that.

    And how exactly do you know that '2e1' is a "scientific notation"? Could be there by accident so the value should actually have been 21 (blackjack anyone?). Now that error just slipped us by because SQL "tries" to think.

    /T

    How do you know 1+1 isn't 11 instead of 2? Maybe someone just typed in a + by accident. Let's just abandon all arithmetic operators, because SQL Server tries to think... :rolleyes:

    True but atleast 1 and 1 are both numeric both in and out off context. Wheras "e" is only valid under some circumstances. With "11" you can do any SubString and still get a valid number. Try doing that on "2e1". Substring('2e1', 1, 2)... valid number... no.

    /T