Database Fundamentals #17: Learning T-SQL
While SQL Server Management Studio (SSMS) provides a robust graphical user interface (GUI), the commands you’re going to use the...
2018-06-18
971 reads
While SQL Server Management Studio (SSMS) provides a robust graphical user interface (GUI), the commands you’re going to use the...
2018-06-18
971 reads
Starting with SQL Server 2016 Sp1 CU2, a new way of directly querying statistics, specifically the histogram, has been introduced:...
2018-06-11 (first published: 2018-05-29)
2,172 reads
Next week, Redgate Software, will be putting on SQL in the City Streamed. These events are a great way to...
2018-06-07
278 reads
I advocate for, use, document, teach, and just downright love, Extended Events. They are so much better than the old...
2018-06-04
367 reads
In case this is your first time hearing of it, PASS is the single largest community of Microsoft Data Platform...
2018-05-21
717 reads
I’m desperately working to finish up a new version of my book on Execution Plans. We’re close, so close. However,...
2018-05-16 (first published: 2018-05-07)
2,594 reads
Twice recently, one on a blog post, and one in a forum post, I’ve seen people state, unequivocally, without reservation...
2018-05-14
329 reads
I’ve been busy getting the videos up on YouTube. If they’re helpful to you, please subscribe. Some point soon I’ll...
2018-05-11
234 reads
I’ve been in love with the concept of a database as a service ever since I first laid eyes on...
2018-05-07 (first published: 2018-04-30)
1,957 reads
Despite a hiccup recently on Twitter where I managed to spam all my followers with links to my YouTube videos...
2018-04-27
471 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