Query memory grants part 2: Varchars and sorting
Why the heck did we make all our columns varchar? That’s a hypothetical question, please.
But now we have to pay...
2019-01-09
149 reads
Why the heck did we make all our columns varchar? That’s a hypothetical question, please.
But now we have to pay...
2019-01-09
149 reads
Disclaimer: I’m still learning PowerShell. I’ve been using it more lately and I want to talk about it more. I’ll...
2019-01-08
448 reads
This is post 3 in the series about query fingerprints. Here’s the previous posts in this series:
Query HashSQL Handle
What is...
2019-01-07
948 reads
I like public speaking, but I haven’t always liked it. It started when I read Dale Carnegie’s book on public...
2019-01-05
47 reads
Let’s talk about how queries use memory, specifically in the execution plan. One of the query operators that use memory...
2019-01-04
234 reads
If you’re on SQL Server 2016 or above, maybe you’re thinking about using the Query Store. That’s good! It’s an...
2019-01-03
1,682 reads
I know this post might sound obvious. This is a very rare problem. But this actually happened to me, and...
2019-01-02
58 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