SQL Server Infernals – Circle 5: Inconsistent Baptists
There’s a place in the SQL Server hell where you can find poor souls wandering the paths of their circle,...
2015-07-23 (first published: 2015-07-17)
2,945 reads
There’s a place in the SQL Server hell where you can find poor souls wandering the paths of their circle,...
2015-07-23 (first published: 2015-07-17)
2,945 reads
Constraints are sometimes annoying in real life, but no society can exist without rules and regulations. The same concept is...
2015-07-07
834 reads
Choosing the right data type for your columns is first of all a design decision that has tremendous impact on...
2015-07-10 (first published: 2015-07-02)
2,233 reads
Object-Oriented programming taught us that generalizing is a good thing and, whenever possible, we should do it. Complex class hierarchies...
2015-06-29 (first published: 2015-06-24)
991 reads
There’s a special place in the SQL Server Hell for those who design their schema without following the Best Practices....
2015-06-17
885 reads
Today I’m starting a new blog series called “SQL Server Infernals”.
Throughout this series, I will take your hand and walk...
2015-06-09
680 reads
I usually don’t post small things like this, but today I fought with this obnoxious problem long enough to convince me that...
2015-06-02 (first published: 2015-05-26)
1,579 reads
Don’t be fooled by the title of this post: while counting the number of rows in a table is a...
2015-05-25 (first published: 2015-05-18)
9,277 reads
If you want to have faster turnaround on your forum questions, you will need to provide enough information to the...
2015-04-24
2,311 reads
One of the things I hate the most about “old” databases is the fact that unused tables are kept forever,...
2015-04-29 (first published: 2015-04-20)
16,880 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