TSQL Tuesday #181 – The first SQL Server Feature that made me go “Wow!”

Comments 0

Share to social media

A blue and white cube with a blue circle Description automatically generated with medium confidence

First off, thank you to Kevin Chant for hosting TSQL Tuesday this month. And equally, thank you for not putting a time frame on your request!

“My invitation to yourselves is to write about a Microsoft Data Platform announcement that you considered to be as amazing as a present. In other words, something which made you go ‘wow’.” For me, it was a simple feature, but when I heard it was coming in the next version, it was as exciting as a fireworks finale!

The most nostalgic time of year

I will admit that the feature I will mention probably won’t be relevant to you, as it has been nearly 30 years since this feature was introduced. But since this is the most nostalgic time of the year, I want to go back, through the mists of times, to a time where we hadn’t even quite begun to fear the changing of the centuries. To a time when we a single CPU was all we had even thought of, computer screens were often colorless, a few megabytes of RAM was all that was needed. It was a simpler time, though to be fair, it was also a time before we had sports on our phones.

Around this time I had started my first job as an accidental database developer. It was never my intention to work in programming, but I had started a job as a network admin and I wasn’t exactly awesome at it. I was way out of my comfort zone, and even to this day, my powers of networking are basically “hope it works out of the box”. Thankfully, for the most part it does at home and I have been surrounded by great pros for my professional career.

When one of the developers moved away, I was asked if I could help finish creating the database application. Sure, why not? Something to try, right? On the positive side, I really liked the concepts of working with data, and the idea of the power of data. On the other side of things, it was freaking tedious. The team leader was (thankfully) big on the fundamentals such as normalization and data integrity. So we had a pretty well designed database and we implemented foreign key protection.

How long ago was this?

Only thing wrong with that was… no FOREIGN KEY constraint support.

So we implemented it all in TRIGGER objects (which was like hundreds of TRIGGER objects too.). I won’t lie and pretend that I remember the exact day when it happened, or even the actual version. I think it was 6.0 back in 1995 or 6.5 a year later (pretty sure it wasn’t 4.21), but when it arrived, so much code that had been written could be removed. Which was great because this was before any of us realized how to write triggers that allowed you to modify more than one row at a time, and at least once I had to make changes to a lot of the triggers we had been using.

It wasn’t until SQL Server 2000 before we got cascading operations and could remove all of the TRIGGER objects that were in use, but honestly, I have never been a tremendous fan of cascading triggers. (There are still a few outlier cases where triggers are useful for foreign key enforcement, but they are very few and far between now.)

This isn’t the only feature I have said Wow to.

There have been so many features over the years that were life changing, of course. In fact, there has never been a version of SQL Server that I just said “meh” too. Of course in the early days, so much of the focus was on the relational engine, so the exciting stuff came fast and furious. Updated JOIN syntax (and removal of the horrible *= syntax for OUTER JOIN operations), Windowing Functions, Graph objects, in-memory tables, columnstore indexes, online operations, Query Store, are just a few. And so many internal changes that just made code run faster without lifting a finger.

But when I saw the question of “what was the wow feature?”, the one that really changed my life has always been FOREIGN KEY constraints.

Load comments

About the author

Louis Davidson

Simple Talk Editor

See Profile

Louis is the editor of this Simple-Talk website. Prior to that, has was a corporate database developer and data architect for a non-profit organization for 25 years! Louis has been a Microsoft MVP since 2004, and is the author of a series of SQL Server Database Design books, most recently Pro SQL Server Relational Database Design and Implementation.