• David Portas (1/14/2009)


    This is a bit of a mess. In SQL Server 2000 semicolons were optional or in a few cases actually not allowed at the end of statements. In 2005/2008 they are mostly optional but are sometimes mandatory.

    I expect semicolons will one day be mandatory for every statement in line with other DBMSs and the SQL standard. It must therefore be good practice always to use semicolons. Unfortunately there's no way to turn on stricter syntax checking for semicolons. That means no matter how careful we are they are bound to get left out somewhere in code and one day we'll all be forced to do a clean-up exercise on the code we're writing today. 🙁

    That's why I'm trying to get in the habit now of writing all my code with semicolons. Not 100% successful, but trying to get there, so I have the right habits when it becomes mandatory.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon