• Paul White NZ (5/29/2010)


    Grant Fritchey (5/28/2010)


    I would argue that while all three compile and run, none of them is "correct."

    In the same way that 2+2=5 for sufficiently large values of 2? 😛

    I have to agree with Grant. What does the formal syntax definition of a select statement specify? I believe it requires whitespace between the SELECT keyword and the select list. The fact that the T-SQL parser has a wiggle (don't know whether it was an intended feature or an unintended consequence of the handling of * in its multiply operator role, so call it a "wiggle" rather than a "feature or a "bug", although I think "bug" would really be more appropriate) which allows it to correct some incorrect syntax doesn't make that syntax correct, it just makes it usable. Of course I may have misinterpreted the BNF definition of the syntax - maybe someone should check me.

    Tom