It’s always parameter sniffing (part 1?)
This is a blog post about a perennial issue. Have you ever had a call in the middle of the...
2019-01-28 (first published: 2019-01-16)
3,048 reads
This is a blog post about a perennial issue. Have you ever had a call in the middle of the...
2019-01-28 (first published: 2019-01-16)
3,048 reads
I use sp_WhoIsActive a lot. I’m extremely grateful for Adam Machanic writing it. It has tons of options that let...
2019-01-28
5,336 reads
So far in this series, I’ve been focusing on the Sort operator. It’s pretty easy for demos since I can...
2019-01-25
698 reads
Did you know that you can compare two execution plans in SQL Server Management?
It’s really cool. I use it a...
2019-01-25
1,006 reads
So you’ve got a SQL Server that you want to monitor. What should you monitor? In my opinion, at bare...
2019-01-22 (first published: 2019-01-14)
2,708 reads
Part of query memory grants, part 4! This post will cover the wait type RESOURCE_SEMAPHORE briefly, but the focus is...
2019-01-21
1,222 reads
This is not a technical post! Just wanted to say that I set up a public email address for this...
2019-01-19
139 reads
When you’re querying the plan cache, you need to know the four primary objects: the query hash, query plan hash,...
2019-01-17
773 reads
I first came across the value for RetrievedFromCache when I was reading a confusing execution plan. At first, I thought...
2019-01-11
735 reads
An example of how I use the query hash
I wrote a blog on what the query hash is, right here....
2019-01-10
6,722 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