You Need a New Hobby
Not sure who this is that is attempting to hack into my blog so desperately, but seriously, time for a...
2018-01-23
305 reads
Not sure who this is that is attempting to hack into my blog so desperately, but seriously, time for a...
2018-01-23
305 reads
I read a lot of history (as you no doubt notice from my other editorials). I’m currently reading an excellent book on the air war in World War One, Marked for Death: The First War in the Air. One of the fascinating aspects of the war is just how fast the technology shifted. At the […]
2018-01-22
66 reads
Query tuning ain’t easy.
Figuring out which index is getting used is one step, and generally simple, look at the execution...
2018-01-17 (first published: 2018-01-08)
2,258 reads
Hello all,
I’ve recently updated my YouTube channel. I’m going to be posting a lot more videos up there. If you...
2018-01-16
326 reads
I recently flew from Boston to the UK through the Heathrow airport. It just happened to be on the day...
2018-01-02
696 reads
Have you ever looked at the properties inside an execution plan and wondered what the units of measure were? I...
2017-12-26 (first published: 2017-12-11)
1,447 reads
In Azure SQL Database for quite some time and now available in SQL Server 2017, Microsoft has put a lot...
2017-12-26
819 reads
The second best thing to questions that people ask is when I sit down to write a book. It’s so...
2017-12-18
772 reads
With all the options available within T-SQL these days, it’s more and more imperative that our code be clear and...
2017-12-11 (first published: 2017-11-28)
2,261 reads
The preferred method for modifying your data within a database is T-SQL. While the last Fundamentals post showed how to...
2017-12-11 (first published: 2017-11-27)
1,817 reads
By Steve Jones
This is timely, as I’m currently on a boat in the Adriatic taking a...
You can find the slides and SQL scripts for my session “Spice up your...
By SQLPals
How to Clear the SSMS Cache (SSMS 21 and Later) Updated...
Comments posted to this topic are about the item Using CHOOSE()
Comments posted to this topic are about the item Re-Seeding a Broken Log Shipping...
Comments posted to this topic are about the item The DBA is Dead! Long...
We have this code that sets some status values and then queries them using the CHOOSE() function in SQL Server 2025.
CREATE TABLE Status
(
StatusID INT,
StatusDescription VARCHAR(20)
);
GO
INSERT dbo.Status
(
StatusID,
StatusDescription
)
VALUES
(0, 'Uncategorized'),
(1, 'Active'),
(2, 'Inactive'),
(3, 'Temp');
GO
SELECT CHOOSE(StatusID, 'Unknown', 'Active', 'Inactive', 'Temporary')
FROM Status;
When the SELECT runs, what is returned? See possible answers