Thank You Andy!
I remember going into Andy Leonard’s session at PASS Summit in Denver. I’m not going to lie, it was kind of sparsely attended, so I got to sit up...
2022-08-02
18 reads
I remember going into Andy Leonard’s session at PASS Summit in Denver. I’m not going to lie, it was kind of sparsely attended, so I got to sit up...
2022-08-02
18 reads
In the last Database Fundamentals post, I explained what a unique constraint was and how you can create them using the GUI. Using TSQL to create a constraint is...
2022-07-25
106 reads
Today Grant wonders why we spend so much time trying to learn about query tuning.
2022-07-23
348 reads
I honestly don’t know when or how I met Wendy Pastrick, but I’m so happy I did. Wendy and I have been friends for a very long time. Thank...
2022-07-19
26 reads
Redgate Software has a policy wherein every 5 years, employees receive a 6-week paid sabbatical. Well, I’m up to year 11 (I skipped a year my first time), so...
2022-07-18
11 reads
Redgate is a great place to work for a lot of reasons. One of those has come up for me. It's time for my sabbatical. Every five years we get six weeks paid leave. Mine starts Monday. I'll still be clearing out my email (the thought of six weeks worth gives me horrors), and I'll […]
2022-07-16
206 reads
I know I can say that I’m a friend of Allen White without getting into trouble. Allen and I have a shared a lot of things over the years...
2022-07-12
118 reads
One of my favorite little bits of information about Extended Events is the fact that everyone running a full instance of SQL Server has deadlock information available to them,...
2022-07-11
42 reads
For two years and three months, since April 2020, I’ve posted a tweet saying “Good Morning!” on every workday. I think I missed one. I was late for a...
2022-07-07
50 reads
I don’t think I’m going too far out on a limb to call Kevin Kline a friend. I’m extremely humbled and honored that I can say that. Kevin is...
2022-07-06
25 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