I’m Speaking at Pass Summit 2019
I am very excited to be heading to PASS Summit 2019 in Seattle next week. It’s one of my favorite weeks of the year. Getting to hang out with...
2019-11-01
25 reads
I am very excited to be heading to PASS Summit 2019 in Seattle next week. It’s one of my favorite weeks of the year. Getting to hang out with...
2019-11-01
25 reads
Bob Pusateri (B|T) tweeted a quote image that really struck a chord with me and elicited a strong reaction from myself. It got me thinking I need to write...
2019-11-08 (first published: 2019-10-22)
1,565 reads
Query hints are always about tradeoffs—typically you are giving up something, such as flexibility, to achieve more consistency, or very specific performance characteristic. One example of this migt when...
2019-10-29 (first published: 2019-10-16)
1,034 reads
Speaking Engagements Check out my new Event Calendar, to see my upcoming and past speaking engagements. You can catch me at various events throughout the year. If you are...
2019-10-15
17 reads
I’ve written about statistics in SQL Server a few times now. Through conversations I am reminded that not everyone keeps their table statistics up to date. Keeping your statistics...
2019-09-26 (first published: 2019-09-18)
513 reads
It is widely known that I am a horrible speller and hate to type code. I tend to use a lot of code snippets and reuse code to avoid...
2019-09-20 (first published: 2019-09-11)
1,267 reads
Several times I’ve been asked what tools are in my performance tuning and SQL Server management arsenal, so I decided to just create this blog to list them out...
2019-09-04
445 reads
Indexes can be incredibly beneficial to your database performance; however, they do come with a cost—indexes both consume storage space and affect insert performance. Therefore, it is important as...
2019-09-11 (first published: 2019-08-28)
2,814 reads
Some of us take days and weeks to write a blog, while others can take two minutes and write a great blog *cough* *cough* Denny (B|T). Why is that?...
2019-07-24
43 reads
My last two blogs were on understanding columnstore and creating columnstore indexes. In this post, I will touch on one last topic, when to use columnstore indexes. As noted...
2019-08-05 (first published: 2019-07-17)
661 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