T-SQL Tuesday #102: Giving Back
This is my diatribe about service and giving back to the community. When done properly, there is a natural born effect of enhancing one's personal life equal in some...
2018-05-09
11 reads
This is my diatribe about service and giving back to the community. When done properly, there is a natural born effect of enhancing one's personal life equal in some...
2018-05-09
11 reads
Last month we had the opportunity to discuss some of the most important tools for a data professional. I took...
2018-05-09
296 reads
One of my most favorite things in the world is the opportunity to deal with extremely varying database and environment...
2018-04-19 (first published: 2018-04-12)
2,747 reads
SQL Server comes with a default SQL agent job installed (for most installations) to help manage the collection of system...
2018-04-17 (first published: 2018-04-06)
4,187 reads
Every now and again we have to deal with a sudden requirements change. When that happens, we sometimes just need to take a step back and evaluate the entire...
2018-04-12
118 reads
What are the tools you love to use? What are the tools that maybe need a little sharpening? What tools do you have that maybe you wish were the...
2018-04-10
13 reads
What are the tools you love to use? What are the tools that maybe need a little sharpening? What tools...
2018-04-10
378 reads
SQL Server comes with a default SQL agent job installed (for most installations) to help manage the collection of system health data. I would dare say this job is...
2018-04-06
83 reads
It may come as no surprise to many that Microsoft has hastened the SQL Server development cycle. Furthermore, it may be no surprise to many that Microsoft has also...
2018-04-01
20 reads
It may come as no surprise to many that Microsoft has hastened the SQL Server development cycle. Furthermore, it may...
2018-04-01
414 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