A Sherlockian Question Of the Day & Why I’m Writing Questions
If you haven’t noticed by now I’ve been writing quite a few questions of the day for SQLServerCentral. It started,...
2014-06-04
338 reads
If you haven’t noticed by now I’ve been writing quite a few questions of the day for SQLServerCentral. It started,...
2014-06-04
338 reads
This is a good question for me to ask. I’ve been learning it, and working through examples in my PowerShell...
2014-06-06 (first published: 2014-06-04)
3,780 reads
Partitioned tables can be a quick and efficient way to (amongst other things) archive data. In the next couple of...
2014-06-09 (first published: 2014-06-04)
5,096 reads
An identity column is an auto incrementing columnAn identity column is typically used as a primary keyA primary key that’s...
2014-06-04
1,064 reads
There are some cases when you need to use a PIVOT function in SQL but you cannot use a CTE....
2014-06-04
1,286 reads
I’ve noticed a recent trend with many presentations and articles on Power BI and Excel functionality. Many of these presentations...
2014-06-03
1,131 reads
Access Granted or Not? is my latest Question Of The Day and I think it represents a pretty good troubleshooting...
2014-06-03
476 reads
I was interested to see that the online voting system has changed this year to one powered by Simply Voting....
2014-06-03
412 reads
I’ve created a simple query performance logging tool for Analysis Services, called the SSAS Performance Logger. The tool allows you...
2014-06-03
487 reads
I haven’t posted much on books lately, here are two that are different:
Inside the Food Network. Definitely some gossip, but...
2014-06-03
354 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