August 6, 2018 at 7:54 am
Like Jeff said, "just look at the MS provided system stored procedures." For a quicker example right click on a table and pick either, "Select Top 1000" or "Script Table as". No semicolons are in the any of the generated scripts. This just encourages one to NOT use semicolons.
- Dan Beggs
Dan Beggs
August 6, 2018 at 8:31 am
They should have added a check to intellisense when they announced statement terminators were going to be compulsory. Instead of enforcing an explicit statement terminator which I see as merely an attempt to make code more readable, they could have a toggle icon like the one in Word which allows you to see the line breaks etc.
MattF
August 6, 2018 at 8:39 am
I agree with you, Steve, I don't believe we'll ever see semicolons required in T-SQL. I've seen hundreds of T-SQL statements written by people, which are still running fine in their respective environments. Always still running even when those SQL Server instances get up upgraded to newer versions of SQL Server. I've seen some semicolons used, but I'd have to say its probably less than 10% of the code I've seen. I don't think Microsoft would want to stop so much T-SQL code by insisting semicolons are required in T-SQL code.
Kindest Regards, Rod Connect with me on LinkedIn.
August 6, 2018 at 8:50 am
Dan Guzman-481633 - Monday, August 6, 2018 6:21 AMAlthough not using semi-colon statement terminators has been deprecated for a decade, using statement terminators is still the exception rather than the rule, even in new development. I'm rather particular about using semi-colon terminators myself event though I don't expect terminators to be a T-SQL requirement in my lifetime.A pet peeve of mine is seeing semi-colons used improperly, preceding a statement instead of terminating one, just to avoid a compile error. I personally don't think it's all that difficult to place the terminator in the proper place, terminating the previous statement. I wish the T-SQL parser was more strict in this regard and adhered to documented syntax.
Not using terminators can introduce some nasty and unexpected behavior: https://www.dbdelta.com/always-use-semicolon-statement-terminators/
--
Dan
Not using statement terminators has never been deprecated by MS, all they did was require that some of the new things they've added require the previous statement to have a terminator. Which is hugely annoying and inconsistent.
August 6, 2018 at 9:21 am
I won't lie - when I saw this title I immediately thought about this:
Anyone else? 🙂
Anyways - for a long time now I have been zealously adding semicolons to code. My time working with Oracle instilled that practice. Now I even have SQL Prompt add them when I format code.
August 6, 2018 at 9:28 am
ZZartin - Monday, August 6, 2018 8:50 AMNot using statement terminators has never been deprecated by MS, all they did was require that some of the new things they've added require the previous statement to have a terminator. Which is hugely annoying and inconsistent.
Actually, not using statement terminators has been deprecated. They just won't make it mandatory until they have fixed all their code first.
August 6, 2018 at 9:29 am
Jeff Mlakar - Monday, August 6, 2018 9:21 AMI won't lie - when I saw this title I immediately thought about this:Anyone else? 🙂
Anyways - for a long time now I have been zealously adding semicolons to code. My time working with Oracle instilled that practice. Now I even have SQL Prompt add them when I format code.
That came to mind, along with some developers that should be effectively terminated.
August 6, 2018 at 9:35 am
Luis Cazares - Monday, August 6, 2018 9:29 AMJeff Mlakar - Monday, August 6, 2018 9:21 AMI won't lie - when I saw this title I immediately thought about this:That came to mind, along with some developers that should be effectively terminated.
What came first to mind was SCSI and the joy of SCSI-voodoo. The last device on a SCSI chain has to be terminated.
As for developers, well, I'll be generous today and say that we've all made mistakes.
August 6, 2018 at 10:14 am
Lynn Pettis - Monday, August 6, 2018 9:28 AMActually, not using statement terminators has been deprecated. They just won't make it mandatory until they have fixed all their code first.
What I find silly about it is that MS didn't require terminators at the end of the new stuff they've been adding, only as terminators to the previous statement.
August 6, 2018 at 10:39 am
dsor - Monday, August 6, 2018 4:42 AMI expect we'll get a tool that puts the semicolons in place to upgrade old sql automatically. The remaining issue then would be any dynamic queries left, which in a reasonable database should be few enough to locate and fix in an afternoon.
When you are talking about a project with multiple developers it is going to take many many afternoons.
412-977-3526 call/text
August 6, 2018 at 10:45 am
ZZartin - Monday, August 6, 2018 10:14 AMWhat I find silly about it is that MS didn't require terminators at the end of the new stuff they've been adding, only as terminators to the previous statement.
Actually, the MERGE statement is required to be terminated by a semicolon.
Not sure about any other new stuff.
August 6, 2018 at 11:25 am
John Rees - Sunday, August 5, 2018 11:49 PMI think it's important that languages are allowed to evolve safely, otherwise the mistakes of our ancestors will forever burden us. Look no further than \r\n or should I say \n, or even \r. Seemingly insignificant decisions can have far reaching consequences, and they slow us all down. Maybe each developer loses only 5 minutes a week thinking about line terminators, or semicolons, but that adds up to a lot for all of us, every year, forever!
I think one small hope for language change is the slow, but relentless, adoption of devops. These techniques push the idea that change can be managed more easily than before. If we can make the test cycle less painful, then people will be able to cope with new releases without panic.
Also, there has to be adequate warning, and easy ways to find problems before they occur.
...
Good points, and people have proposed solutions similar to what you did, but so far MS hasn't moved on.
August 6, 2018 at 11:26 am
Sean Redmond - Monday, August 6, 2018 3:21 AMI note that Microsoft don't just say, support will be withdrawn in the future, they give a specific roadmap as to until when what levels of support will be available. Something like this for upcoming and deprecated features would be welcomed.
The problem here is always sales. When xx% of your revenue comes from large customers that don't want to review all code and make changes, it's hard to be fascist.
August 6, 2018 at 11:29 am
roger.plowman - Monday, August 6, 2018 7:08 AMI actually have started using semi-colons to terminate lines, but I have to say T/SQL syntax is a nightmare mish mash of 1960s era design that somehow escaped the Grim Reaper...much to everyone's sorrow.
Yep
Viewing 15 posts - 16 through 30 (of 34 total)
You must be logged in to reply to this topic. Login to reply