SQL Saturday #34
The event is this Saturday. Take a look at our sponsors, speakers and the program. It’s going to be a...
2010-01-27
601 reads
The event is this Saturday. Take a look at our sponsors, speakers and the program. It’s going to be a...
2010-01-27
601 reads
Phil Factor’s most recent guest editorial over at SQL Server Central has, to a degree, pointed out that the emporer’s...
2010-01-25
808 reads
I needed to create an identical index on a bunch of tables within one of my projects (yes, I know...
2010-01-21
1,813 reads
Buck Woody recently asked a question; how do you design a database. He outlined the process he followed and asked...
2010-01-18
1,922 reads
Another one of the DBA bloggers games of tag is occurring. I’ve been asked by Tom LaRock to answer Paul...
2010-01-18
754 reads
I’ve kind of been embarassed to post these despite the fact that I received them a couple of weeks ago....
2010-01-13
586 reads
Aaron Bertrand has put in a Connect request for a feature whereby data returned as a grid from a query...
2010-01-13
754 reads
Kathi Kellenberger’s fantastic new article is available in the latest issue of SQL Server Standard. There are a lot more...
2010-01-13
841 reads
I’ve wracked my brain for some bit of puzzle that I could present as part of TSQL Tuesday #2 and I...
2010-01-12
1,132 reads
You must read this post from Tim Ford to understand why I might do this on my technical blog. But...
2010-01-11
886 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