Hacker News new | ask | show | jobs
by dspillett 520 days ago
> SQL Server is one of the few commercial DB's that does real nested transactions

More or less. The default ROLLBACK behaviour is to roll back the whole nest. You have to use SAVE TRANSACTION instead of BEGIN TRANSACTION and specify the name in ROLLBACK. If doing this in a procedure that may or may not be part of a nested transaction (an explicit transaction wasn't started before it was called) you have to test to see if you need to BEGIN or SAVE¹ and what to do if a rollback is needed (you likely don't want to ROLLBACK everything if you used SAVE, but have no option if you used BEGIN). Not exactly intuitive. And saved transactions can cause excessive lock escalation, impacting concurrent performance.

SQL Server is generally a damned fine product overall, both generally and compared to a lot of other things emitted by Microsoft, but it isn't even close to perfect in some areas.

----

[1] ref: https://learn.microsoft.com/en-us/sql/t-sql/language-element...

1 comments

Thanks for the clarification.

I'm not one to compliment Microsoft software products, but Analysis Services and SQL Server, at least when I used them at the time over 10 years ago, seemed like darn fine products (which they purchased from someone else, I believe...)

SQL Server itself came from Sybase originally, with them and MS working on it as partners for a number of years when it was an OS/2 product, so it wasn't a purchase-a-working-product-and-rebrand-it deal. As Windows NT gained ground, MS & Sybase parted ways (amicably IIRC, when the partnership agreements expired MS licensened the source that Sybase owned and bought out exclusive use of the product name in relation to products for Windows – for a time MS's SQL Server still carried Sybase copyright messaging along with MS's own).

SQL Server v7 was a rewrite of significant parts of the internals, so from that point it is probably fair to call it an MS product quite distinct from Sybase's (which itself continued to be separately developed including significant but different improvements/reengineering of the internals), though still showing some signs of its heritage.