Say Thank You
I was approached by a man at SQL Bits who only wanted to thank me for blogging. He said, “I...
2014-08-13 (first published: 2014-08-06)
8,119 reads
I was approached by a man at SQL Bits who only wanted to thank me for blogging. He said, “I...
2014-08-13 (first published: 2014-08-06)
8,119 reads
Speaker of the Month is now officially one year old.
I went back and reread my first post. The goals were...
2014-08-08 (first published: 2014-08-01)
7,055 reads
There seemed to be some question whether my comfort level with my own masculinity would prevent me from wearing these:
Oh...
2014-07-23
706 reads
I took part in the PASS Summit 2014 selection committee this year because I was really curious about seeing how...
2014-07-21
674 reads
I wouldn’t say it’s common knowledge that you should look at execution plans when tuning queries, but it’s not exactly...
2014-07-17 (first published: 2014-07-15)
10,311 reads
Another month another bunch of great presentations. I almost don’t want to do this any more. It’s hard. I sit...
2014-07-11
568 reads
Red Gate Software is running a campaign around coping with the worst day of a DBAs life. We’ve been posting...
2014-07-08
874 reads
Oh we are a bunch of high school kids at heart. Maybe high school never ends (and there’s a nightmare,...
2014-07-03
1,123 reads
Statistics are one of the single most important driving factors for the behavior of the query optimizer. The cardinality estimates...
2014-07-03 (first published: 2014-07-02)
2,207 reads
I no more than finished my rant from last week than I started thinking about all the reasons why a...
2014-06-30
1,644 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