last day (15 days later) » 

19:59
9
A: What does the GO statement do in SQL Server?

Tibor KarasziGO has been well addressed in other answers. Let me add some about semi-colon: A long long time ago, this wasn't something we used. But the SQL standard (ANSI/ISO SQL) specified that a SQL statement should end with semi-colon. So at a certain version, MS allowed it to comply with ANSI SQL. But it...

The doc still states "it will be required in a future version", albeit that future version will likely be beyond our lifetime. Deprecated or not, I still recommend semi-colon statement terminators to avoid surprises and comply with the ANSI standard.
I don't disagree with it being a good practice to have them there, Dan. As for deprecation, I was going by the rather short list of deprecated features for SQL Server 2019. I guess that BOL isn't totally in sync regarding this. docs.microsoft.com/en-us/sql/database-engine/…
The SQL 2017 deprecation page lists semicolons under the section "deprecated in a future version" so I guess it's not deprecated now but that not using them will be deprecated per the text "The following SQL Server Database Engine features are supported in the next version of SQL Server. The specific version of SQL Server has not been determined." Lots of wiggle room, especially considering "We strive not to remove a deprecated feature from future releases to make upgrades easier."
Yes, but the SQL 2019 deprecation list is empty. I.e., not using semicolon is not deprecated. And since not using semi-colon is available in 2019, there's no reason to go back to what MS thought they could deprecate a couple of years ago. That is irrelevant now, since we have the new list where this isn't deprecated anymore. I guess we're both being pedantic here, dealing with nuances without any real-world significance. It is a good idea to have them there, I agree. But realistically, MS won't remove them for along long time. (And we argue on how MS states this in the doc...).
Semicolons are required in Oracle. Semicolons are required in C and many other programming languages. Do you want your fingers to learn the semicolon habit or not? After a year of flipping between SQL Server and Oracle on almost an hourly basis, I decided to go for 100% semicolons in SQL Server (except the odd one that I forget!).
19:59
@DanGuzman and Tibor: I think you're misreading the SQL 2019 doc (due to MS being forgetful when creating that page). It should have the same note at the top that the 2017 page has: "This list is identical to the SQL Server 2016 (13.x) list. There are no *new deprecated or discontinued Database Engine features announced for SQL Server 2019 (15.x).*" (I adjusted for 2019 and emphasized). I think the context makes it clear that the 2016 list is still deprecated given that it also includes TEXT / NTEXT types, numbered procedures, system tables, etc. I definitely recommend using semicolons.
@Solomon. I don't think MS forgot something. I really do think that nothing is deprecated. SQL Server is cloud-first and the Azure SQL variants are versionless. Being versionless, MS really can't get away with something suddenly disappearing. The consequence of this IMO is that the doc is correct and MS got their act together and accepted the consequence of Azure SQL being versionless: They can't remove anything anymore, and of course this trickles down to the on-prem versions. I'll see if I can get a confirmation of this, though...
Tibor (and @DanGuzman ): Features can be deprecated and never removed. Deprecated indicates that a feature has been superseded by something better and is best to not use. MS is still deprecating features as can be seen in this discussion I had with them early last year (I hadn't remembered it when I commented earlier): github.com/MicrosoftDocs/sql-docs/issues/3989 . Also, Azure SQL isn't exactly "versionless", they're just the most current version with deprecated features not being removed to improve backwards compatibility. @@MICROSOFTVERSION should report the correct value.
I understand all this, Solomon, but I don't agree with your interpretation. My interpretation is that nothing is deprecated as of SQL 2019 in one broad documentation "sweep" (the one I linked to), but the separate documentation sections (like the one for sp_changedbowner) haven't been updated to reflect this harsh reality. I absolutely understand that Azure SQL is of some version (it is SQL server, after all), but MS themselves promotes this as "versionless" and one consequence of this is that they can't remove features anymore. This is all very theoretical, of course... :-)
Tibor: Deprecation doesn't guarantee removal; the doc states the "feature is in maintenance mode only. No new changes will be done, including those related to inter-operability with new features...For new development work, we do not recommend using deprecated features.". That GitHub issue was them adding the deprecation notice. Features like NTEXT are definitely deprecated even if never removed. And, SQL Server still tracks deprecated features: DECLARE @ INT; SELECT * FROM sys.dm_os_performance_counters WHERE [object_name] LIKE N'%:Deprecated Features%' ORDER BY [cntr_value] DESC;
Deprecation used to have a formal meaning, where when something was deprecated, it would be removed within x versions. Clearly MS did a mistake here (for instance deprecating not using ;) so they couldn't follow their own set rules. The situation spiraled into absurdness. So in the end, MS now deprecates nothing. Your quote is for an earlier version of SQL Server, where I refer to the most recent version. No, NTEXT is not deprecated anymore. If you can point to the documentation for SQL server 2019 stating it is, I will change my mind.
So, having determined that ntext isn't deprecated, lets us see what the documentation does say. For the doc entry for ntext it says that NTEXT will be removed. That is in conflict with the general statement for deprecation. What does that tell us? The documentation is a mess. The same goes for the trace events and the perfmon counters, MS just don't maintain these things anymore. The code behind them is just carried forward from one release to another. Like having dry rot in an old shed you never use, while having other interesting projects for the main building you want to do...
19:59
Hi Tibor. I understand what you're saying, though I still disagree. However, it occurs to me that we don't need to compare interpretations when Microsoft should simply tell us what they mean. So, I have asked the documentation team to update the page that you linked to (regarding SQL Server 2019 not deprecating any features) with explicit wording: What exactly does "SQL Server 2019 does not deprecate any features" mean?. And now we wait 🙃.
Perfect Solomon! I've managed to get some attention from my side as well, so hopefully that'll generate something. :-)
Hello Tibor (and @DanGuzman ). Just to follow up on this: the MS doc team updated the "Deprecated database engine features in SQL Server 2019" page a few days ago. It now states: "SQL Server 2019 (15.x) does not deprecate any features beyond those deprecated in prior releases:" (emphasis added) followed by links to the 2016 and 2017 deprecated features pages.
Thanks Solomon! There's also the "Deprecation guidelines" section, which might not have been there before (it isn't in my downloaded BOL). Now we have consistency, at last. :-)
Tibor: yer welcome :-). And correct, the guidelines and query were also added in this most recent update. You can see all of the additions in this commit: github.com/MicrosoftDocs/sql-docs/commit/…

last day (15 days later) »