Lead Blocker
Blocking is just part of life I’m afraid. Because we have locks (and yes we have to have them, and...
2017-01-18
3,194 reads
Blocking is just part of life I’m afraid. Because we have locks (and yes we have to have them, and...
2017-01-18
3,194 reads
You’ll frequently hear that you should add the COPY_ONLY clause when taking an ad-hoc full backup to avoid messing up...
2017-01-19 (first published: 2017-01-16)
2,559 reads
I recently had an interesting time getting the SQL Auth logins on a new instance working. I was doing a...
2017-01-12
814 reads
I’m a big fan of the sp_help system stored procedures, which is why I’ve been a bit disappointed that the...
2017-01-10
466 reads
I’ve been studying Azure recently and came across a really interesting Azure site.
resources.azure.com
To give you an idea why I find...
2017-01-13 (first published: 2017-01-05)
1,465 reads
Honestly, I’m only posting this because I had a hard time finding anything posted on this error and I found...
2016-12-28
1,521 reads
I was thrilled to host TSQL Tuesday #85, the last TSQL Tuesday of 2016. My subject was backup and recovery...
2016-12-26
474 reads
I’ve been using sp_helptext for years. Honestly I probably end up using it at least once a day. But I...
2016-12-21
1,955 reads
Years ago I worked for a company that had a rather cool way of handling requests. When we ran the...
2016-12-19
462 reads
The other day I received an email asking for some help with a school project. Would I please answer some...
2016-12-15
465 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