What I learned from “The boy who cried wolf”
I was thinking about the story The boy who cried wolf earlier today and realized that it has some lessons ... Continue reading
2020-06-12 (first published: 2020-05-28)
492 reads
I was thinking about the story The boy who cried wolf earlier today and realized that it has some lessons ... Continue reading
2020-06-12 (first published: 2020-05-28)
492 reads
The other day I had a brief conversation with Itzik Ben-Gan (about|twitter) on twitter and I have to tell you ... Continue reading
2020-05-26
144 reads
The other day I got this rather interesting error while connecting to an Azure SQL DB. I was connecting using ... Continue reading
2020-05-20
110 reads
An interesting question came to my attention the other day. A strange operation problem in SQL Server: -100/-100*10 = 0 ... Continue reading
2020-05-18
418 reads
The other day I had a random thought. I wonder if there is a version of Azure Portal for Android. ... Continue reading
2020-05-13
81 reads
A good friend of mine (Randolph West (blog|twitter) asked that someone Explain CROSS APPLY like they are 5. So, here’s ... Continue reading
2020-05-25 (first published: 2020-05-11)
1,831 reads
This is an interesting error that you’ll occasionally get when accessing an AD/Windows ID. Msg 15404, Level 16, State 11, ... Continue reading
2020-05-06
180 reads
A few months ago I suggested writing blog post(s) as a great way to learn and document your progress (among ... Continue reading
2020-05-04
32 reads
You restored that database, did you remember to change the owner or is it still you? How about that job ... Continue reading
2020-04-29
22 reads
When connecting to a SQL Server instance sometimes you’ll see (local), localhost or even just a single period (hard to ... Continue reading
2020-05-12 (first published: 2020-04-27)
389 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