Edward Pollack recently wrote an excellent wish list for T-SQL features he’d like to see in an upcoming version of SQL Server. Now, it’s my turn. This article covers what I’d like to see the most.
Extensibility added to SQL Server
I’ve had this wish for as long as I’ve worked with SQL Server, and I started with it in 1992! I can’t tell you how many times I’ve been in meetings with the product group, they show us a new feature, and I ask how I can build things that would enhance or complete what they’ve done. The response has almost always been “this is version 1; hopefully we’ll get to extensibility in version 2 or later”.
And, put simply, they never get there.
The problem I see with this, is that it often undermines – or worse, wastes – the product group’s own work. If they ship a feature and it’s not complete, there’s no way for us to fill in enough of what’s missing to make it useful. Then, when the feature doesn’t get enough traction in the market, it often just falls by the wayside. There are endless examples of this, but let me pick just one.
Back in SQL Server 2005, Microsoft added the ability to create our own data types as part of SQL CLR. It was great to see some extensibility appearing but, as soon as I looked into it, I realized I couldn’t use it to create what I wanted as there was no way to appropriately index the data type. I could only index properties of the data type via computed columns – not the data type itself.
This is because, with new data types, you often need a different type of index. So, I kept asking for the ability to create a custom index type, but the response was always along the lines of, “we don’t really need a new index type.”
But clearly we did need a new index type…
…and this has been proven again and again over the years. With the XML data type, Microsoft added two new index types. In SQL Server 2008, when they added their own new SQL CLR-based data types for geometry and geography, they added a new spatial index. For me, this should have been just one instance of a new custom index type.
It was no surprise, then, to see a new index type created when JSON was later added. When the vector data type was introduced, so was a new type of index for it. Since I now work with Azure SQL Database so much, and Microsoft removed their initial support for SQL CLR, we try to avoid using it in any of our SQL Server work. And we’re back to having no meaningful way to extend the language.
Meanwhile, with my other work in PostgreSQL, it’s something I really appreciate – and it’s part of the reason why the platform is considered more “developer-friendly” by many people. I’d like to see the SQL Server team think more about building an ecosystem rather than just shipping a product where they feel they need to supply everything.
Constants in SQL Server
I review large amounts of T-SQL and I so often see hard-coded values throughout the code. Performance-wise, it’s totally fine to write code like:
WHERE AdditionalStatus = 146
But as for code quality? What on earth is that ‘146’? Even if there is a comment there to explain it, it’s not needed.
Instead, we can put values like this in a variable, perhaps at the top of our code:
DECLARE @EXTENDED_STAY_STATUS int = 146;
and use it in code:
WHERE AdditionalStatus = @EXTENDED_STAY_STATUS
Unfortunately, though, it might not execute the same. You see this all the time when someone is trying to debug stored procedure code – they replace the parameters at the top with variables and then find it doesn’t run the same.
If we had true constants, the optimizer could know about them, and use them like literal values:
DECLARE @EXTENDED_STAY_STATUS CONSTANT int = 146;
I’d like to go even further and have the ability to declare constants at the database level – and potentially at the server level, too (not just session level.)
Enjoying this article? Subscribe to the Simple Talk newsletter
Consistency in SQL Server
Given the requirement for backward compatibility, this one is hard…but I really wish there was more consistency in how features and language elements are designed for SQL Server. We have names like DATETIMEOFFSETFROMPARTS, for example, but also have DENSE_RANK, COUNT_BIG, etc. There never seems to be any rationale for when names have spaces separating or are just run together.
The bigger issue, though, is the logical inconsistency. Even in SQL Server 2025, functions were added for EDIT_DISTANCE() and JARO_WINKLER_SIMILARITY(). What’s wrong with that, you might ask? Well, one of them – EDIT_DISTANCE – is named after what it’s measuring. And the other one – JARO_WINKLER_SIMILARITY – is named after the algorithm used!
You’d hope the naming would follow the same pattern: either named after the effect, or after the algorithm. I’d expect that across versions, but even more so within a single version of the product. EDIT_DISTANCE() should probably have been called LEVENSHTEIN_DISTANCE() for the Levenshtein (or Damerau-Levenshtein) algorithm.
I’d also like to see consistency regarding abbreviations. For example, I wish EOMONTH() was END_OF_MONTH(). Did we really need to save 3 characters in the same version as other functions with really long names were shipped? I’m told it was named after an old Excel function, but is that really how we want new language features designed?
Also, while we’re at it – why is there no START_OF_MONTH()?! And we had tinyint, smallint, int, and bigint, but then we got smalldatetime, datetime, and datetime2.
Then there’s SYSDATETIME(), SYSDATETIMEOFFSET(), and SYSUTCDATETIME(). You would have guessed the new option for getting just the date would be SYSDATE() right? No! It’s CURRENT_DATE. We still don’t have SYSUTCDATE(), either.
We don’t need to confuse users like this.
Enumerations in SQL Server
Enumerations are a static ordered set of values. For example, I might have the need to store a column called NextAction, with the allowable values being:
- Open
- Process
- Close
- Delete
In T-SQL today, there are two options at our disposal. First, we could define a simple table called Actions, where we have one column called Action, add those four rows, then define a foreign key from the NextAction column to the Actions.Action column. This would work.
However, if we wanted them to appear in the order above (Open/Process/Close/Delete), we’d need to have another column – perhaps an identity or sequence – in the Actions table to specify that order. Additionally, to limit the range of allowed values in the NextAction column, you could add a CHECK constraint.
There are many scenarios where I just wish we could use enumerations instead. After all, PostgreSQL supports them already. The SQL Server equivalent could look like this, perhaps:
CREATE TYPE Action
AS ENUM('Open', 'Process', 'Close', 'Delete');
CREATE TABLE dbo.Processes
(
...
LastAction Action,
NextAction Action,
...
);I’d also like to use them not just for simple ordered lists but, instead, as a set of enumerated constants. For example:
CREATE TYPE RequiredAction AS ENUM CONSTANT int
(
Open = 4279,
Process = 2327,
Close = 2232,
Delete = 2423
);This would allow me to write code like WHERE NextAction = RequiredAction.Close;, which would work really well with IntelliSense – just like it does in C# and other languages.
It could also be used to provide every constant required: WHERE AdditionalStatus = CONSTANTS.ExtendedStayStatus…
…and extended to be used for database and server constants: OR LastStatus = DATABASE_CONSTANTS.FinalStayStatus
Code libraries in SQL Server
One of the free resources I provide is SDU Tools. It’s a library of functions, views, procedures, etc, that you can add to a database. That’s OK, but I really wish you didn’t need to add them to every database. I should be able to create a library that’s added to the server and can then be used from any database. More importantly, I wish I could create functions that work, and perform at the same speed as, the ones built into T-SQL.
There are so many things we can’t do in it when we build functions. We can’t handle overloaded and optional parameter types properly, for example, and we can’t have dynamic output data types like the recently added date-related functions DATETRUNC() and DATE_BUCKET(). And again, note the inconsistency in their names.
These are concepts that already exist in other database engines. SQL Server really needs them, too.
Fast, reliable and consistent SQL Server development…
What else I’d like to see changed (or added) to SQL Server
Here’s what else I’d like to see changed, or added, to SQL Server.
DROP DATABASE IF EXISTS
DROP DATABASE IF EXISTS is currently useless as it fails if anyone is connected to the database. The suggested option for changing the database to single user first is not reliable, as it has to be done from master. Ultimately, it needs to have a WITH ROLLBACK IMMEDIATE option added to it.
ALTER TABLE DROP COLUMN
ALTER TABLE DROP COLUMN needs an option to drop any default constraint on the column. Other engines like PostgreSQL don’t allow you to name default constraints, so don’t have this issue. In T-SQL, you need to know the name of the constraint to drop it.
Ideally, though, default constraints shouldn’t have an exposed name in the first place. Encouraging users to use a system-generated name – and then requiring them to know the name before you can drop a column – just doesn’t make sense.
Arrays
When I first started using SQL Server in 1992, I immediately missed having arrays. The argument always was that they were a non-relational concept, but there are many scenarios where they make sense.
File I/O (input/output)
In his wish list, Edward made a good point about working with other file types, particularly compressed file formats like parquet. This has always been a weakness in SQL Server, but it’s not just file input. If you want to output a CSV or parquet file, it should be trivial – and in other database engines, it is. But not in SQL Server.
On a related note, far too many commands in T-SQL (like OPENROWSET()) don’t take variables – they require literal values. As a result, we end up writing a lot of dynamic code – making our T-SQL code even messier than it should be. This needs to be fixed. The options for file input/output should work well for both local file systems (on-premises), and cloud-based storage systems (both on-premises and cloud-based SQL).
UTF-8
I’m not a fan of how UTF-8 has been implemented within SQL Server. The biggest issue, for me, is defining columns. If I say VARCHAR(10) with UTF-8, I want that to mean up 10 characters. I don’t want it to mean “somewhere between 2 and 10 characters” like it currently does (since it’s based on bytes and depends on which characters you happen to store.)
How is this useful to a developer? It’s worth noting that again, PostgreSQL does this sensibly. At least give us the option to say VARCHAR(10 CHARACTERS) or similar, given we probably can’t fix the current implementation.
STRING_SPLIT
The SQL Server team have made several attempts at STRING_SPLIT, but it’s still not where I want it to be. For example, the delimiter says it needs to be a single character. Sometimes I want to use an empty delimiter as I want to return all the characters in the string one-by-one. Other times, I want to handle multi-character delimiters like double-pipes ( ‘||’ ), as that’s what’s in the incoming data.
Shortcut operators
It was great to see IS DISTINCT FROM and IS NOT DISTINCT FROM added to SQL Server, but I really wish they had shortcut operators like WHERE SomeValue == @ProvidedValue and == meant "IS NOT DISTINCT FROM".
The negative form of this is the most commonly used, and we did get << and >> for LEFT_SHIFT and RIGHT_SHIFT, which of course are welcome but probably won’t be used as often.
Natural joins
If we’re just joining tables using declared foreign keys, we should be able to just ask for a natural join that follows the keys. We shouldn’t need to spell it all out in ON clauses. Bonus points if we could omit interim tables like we can in DAX.
Upcoming possibilities (other SQL Server suggestions)
For some excellent coverage of suggested SQL changes from the PostgreSQL BMA meeting, which took place June 2026 in Stockholm, Sweden, I’d suggest reading this article.
From that article, I think the following are worth considering:
QUALIFY
We use WHERE after FROM, and HAVING after GROUP BY. QUALIFY applies a filter at the window function level.
INSERT BY NAME
This suggestion allows matching up column lists in INSERT statements with returned SELECT values based on the names of the columns rather than position.
SELECT LIST EXCLUDE
There’s a common requirement to select all the columns in a table except for one or two. An EXCLUDE clause can do just that. But the suggestion here is to go further, allowing REPLACE and RENAME clauses as well. Interesting.
JOIN TO ONE
This suggestion is to add a TO ONE clause to a JOIN. The best use case for me would be where I have a LEFT OUTER JOIN and instead of matching zero or more rows, I want to only match zero or one row. If more than one is matched, then an error is thrown. Also interesting.
Summary
Back in 2014, I remember asking a product group member what was new in T-SQL, and they responded by asking me why I’d even want any enhancements. He thought that “T-SQL is done”, as though it was complete.
I’m so glad that, now, the SQL Server team isn’t thinking that way. They’ve started putting in real effort in this area, and it’s good to see. There’s a lot to do.
The post What’s missing in T-SQL? My wish list of features that developers actually need in SQL Server appeared first on Simple Talk.
