May 11, 2013 at 3:35 am
Jeff Moden (5/10/2013)
I understand what the semi-colon can do so far as ending a statement but it worked just fine before without it before.
Increasing complexity of the language. SQL is not an LLR-1 language as it is and hence is not that easy to write a parser for, on that jandles all constructs. As more and more gets added, so the parser has to get more and more and more complex. Statement terminators are a definitive way to tell the parser that a statement has finished and another one is about to start.
You said earlier that the parser can always tell if a semi-colon is needed, but it actually can't. Get the WITH wrong in a query that has hints and you get an error saying that a semicolon is required when it isn't. That's a default error for 'Can't figure this out, there's a WITH keyword, maybe they left out a ;' With C++, leaving out a semicolon got you 20 or more errors that never once mentioned a missing semicolon that would start on the line following the missing ;
I don't know what your formatting convention is but I don't need a semi-colon at the end of even the longest of queries to tell me that a new query has started whether the code has any comments or not.
Semicolons aren't for you.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 11, 2013 at 12:40 pm
Yep. I understand and appreciate all of that. It's a darned shame that it has to come to that.
I kowtowed to the future requirement for semi-colons and started using them religiously even in my posts about a year ago. Us old dogs can learn new tricks if it means keeping the supply of bones coming in. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
May 11, 2013 at 4:22 pm
To be honest, I doubt they'll be required everywhere anytime in the next 8-10 years. Required in more and more places around new features, yes. Required everywhere, well, we still haven't got rid of old SQL 2000 stuff that's been deprecated for close on 8 years...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 12, 2013 at 7:40 pm
Understood. Now, if we could just get them to stop deprecating and removing useful stuff like xp_GetFileDetails and sp_MakeWebTask.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 12, 2013 at 11:33 pm
The semicolon character is a statement terminator. It is a part of the ANSI SQL-92 standard, but was never used within Transact-SQL.
Jamie Ingram
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply