When I get stumped I ….
I work with a reasonably large team of DBAs. There are 9 of us and we support not only 70+...
2012-10-02
1,207 reads
I work with a reasonably large team of DBAs. There are 9 of us and we support not only 70+...
2012-10-02
1,207 reads
I’ve always found clusters a pain in the neck. For my latest pain I just spent the last 2 days...
2012-09-26
636 reads
A couple of days ago I read Steve Jones’ blog on creating a user defined table type. This reminded me...
2012-09-25
1,192 reads
I recently turned on OPTIMIZE FOR AD HOC WORKLOADS for the first time on one of my servers. When I...
2012-09-18
1,377 reads
2012-09-13
2,876 reads
As a database administrator I get lots of security requests. “Please grant me read authority on this table, write on that table,...
2012-09-10
750 reads
2012-09-07
2,800 reads
My manager has been quietly laughing under his breath at me for years. Usually because I much prefer queries and...
2012-09-02
4,135 reads
I came across this handy dandy little setting earlier this year. It was well hidden from me, by which I...
2012-08-27
676 reads
In 12 years of working with SQL it was only last year that I came across the keyword DEFAULT and...
2012-08-20
1,355 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