Extended Events File Initialization Failure
It should come as no surprise that I write a lot of articles about Extended Events (XE). This happens to...
2018-03-21 (first published: 2018-03-09)
5,945 reads
It should come as no surprise that I write a lot of articles about Extended Events (XE). This happens to...
2018-03-21 (first published: 2018-03-09)
5,945 reads
Not long ago, I wrote a rather long article about a new-ish feature within SQL Server Management Studio (SSMS) that...
2018-03-15 (first published: 2018-03-05)
1,866 reads
One of the recommended methods to trap payload data in an XE session is via the use of the event_file target. Sending data to a file has numerous benefits...
2018-03-09
52 reads
As of SSMS 17.4 we have been given the ability to control XEvents Profiler just a tiny bit more. For what it is worth, we as Database Professionals love...
2018-03-05
26 reads
One of my all-time favorite things in SQL Server is security. No matter what, it always seems that there is a new way to abuse permissions. When people abuse...
2018-01-24
33 reads
One of my all-time favorite things in SQL Server is security. No matter what, it always seems that there is...
2018-01-24
533 reads
Conquering Challenges
I really like the topic of the TSQLTuesday party today. Today we have been instructed in no uncertain terms...
2018-01-19 (first published: 2018-01-10)
1,082 reads
A quick way to have your day turned upside down and rip your gut out with nerves and anxiety is...
2018-01-18
1,015 reads
A quick way to have your day turned upside down and rip your gut out with nerves and anxiety is to come in one day to find that users...
2018-01-18
17 reads
Every now and then I find a topic that seems to fit perfectly into the mold of the theme of...
2018-01-17 (first published: 2018-01-05)
1,508 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